Skip to content

Commit e93882d

Browse files
authored
feat: Sticky head sidebar
Resolves #235
1 parent 420af97 commit e93882d

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

src/css/nav.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ html.is-clipped--nav {
177177

178178
.nav-panel-menu .context {
179179
padding: 0.8rem 1rem;
180+
padding-bottom: 0;
181+
margin-bottom: 0.5rem;
182+
position: sticky;
183+
top: 0;
184+
background-color: var(--body-background-color);
185+
z-index: 99;
180186
}
181187

182188
.nav-panel-menu .context .title {
@@ -252,9 +258,10 @@ html.dark-theme button.browse-version:hover {
252258
.nav-menu .search {
253259
position: relative;
254260
border: 0 none;
255-
height: 44px;
261+
height: 40px;
256262
display: none;
257-
margin-bottom: 0.5rem;
263+
margin: 0 -1rem;
264+
margin-top: 1rem;
258265
}
259266

260267
.nav-resize {

src/css/vendor/search.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
color: var(--body-font-color);
1313
background: var(--body-background-color);
1414
text-align: left;
15-
padding-left: 35px;
15+
padding-left: 50px;
1616
border: 1px solid var(--nav-panel-divider-color);
1717
border-left-width: 0;
1818
border-right-width: 0;
@@ -67,7 +67,7 @@
6767
.DocSearch-Button svg {
6868
position: absolute;
6969
top: 10px;
70-
left: 10px;
70+
left: 25px;
7171
width: 20px;
7272
fill: var(--body-font-color);
7373
}
@@ -333,5 +333,9 @@ a.ais-Hits-item:hover {
333333
.DocSearch-Button {
334334
border-left-width: 1px;
335335
border-right-width: 1px;
336+
padding-left: 35px;
337+
}
338+
.DocSearch-Button svg {
339+
left: 10px;
336340
}
337341
}

src/partials/nav-explore.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
d="M384,224c-17.7,0-32,14.3-32,32s14.3,32,32,32s32-14.3,32-32S401.7,224,384,224L384,224z"
1919
></path></g></svg>
2020
</button>
21+
{{> nav-search}}
2122
</div>

src/partials/nav-menu.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{> nav-search}}
21
{{#with page.navigation}}
32
{{> nav-tree navigation=this}}
43
{{/with}}

0 commit comments

Comments
 (0)