Skip to content

Commit 5311913

Browse files
authored
[docs] Keep top-bar visible (#12464)
This commit ensures the top-bar is always visible, rather than being hidden on scrolling or navigating to a target.
1 parent be92d65 commit 5311913

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

doc/_themes/sphinx13/static/sphinx13.css

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ body {
2020
}
2121

2222
.pageheader {
23+
position: sticky;
24+
top: 0;
25+
z-index: 99;
26+
height: 3rem;
2327
display: flex;
2428
column-gap: 1em;
2529
align-items: center;
@@ -80,6 +84,9 @@ div.body {
8084
}
8185

8286
div.related {
87+
position: sticky;
88+
top: 3rem;
89+
z-index: 99;
8390
display: flex;
8491
color: white;
8592
background-color: var(--colour-sphinx-blue);
@@ -107,16 +114,15 @@ div.sphinxsidebarwrapper {
107114

108115
div.sphinxsidebar {
109116
position: sticky;
110-
top: 0;
117+
top: 4.6rem;
111118
align-self: flex-start;
112-
height: 100vh;
119+
height: calc(100vh - 4.6rem);
113120
width: 250px;
114121
min-width: 150px;
115122
overflow-y: auto;
116123
overflow-wrap: break-word;
117124
margin: 0;
118-
padding-right: 15px;
119-
padding-top: 0.5em;
125+
padding: 0.5em 15px 0.5em 10px;
120126
font-size: 1em;
121127
}
122128

@@ -207,6 +213,11 @@ div.footer a {
207213

208214
/* -- body styles ----------------------------------------------------------- */
209215

216+
.body :target {
217+
/* ensure targets are not obscured by top-bar when they are navigated to */
218+
scroll-margin-top: 6.5rem;
219+
}
220+
210221
p {
211222
margin: 0.8em 0 0.5em 0;
212223
}

0 commit comments

Comments
 (0)