Skip to content

Commit cad0fce

Browse files
cynecxGuillaumeGomez
authored andcommitted
rustdoc: don't use overflow for main, instead make the sidebar sticky
1 parent e2467f2 commit cad0fce

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/librustdoc/html/static/css/rustdoc.css

+14-16
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ main {
257257
position: relative;
258258
flex-grow: 1;
259259
padding: 10px 15px 40px 45px;
260-
height: 100vh;
261-
overflow-y: auto;
260+
min-width: 0;
262261
}
263262

264263
.source main {
@@ -325,12 +324,13 @@ nav.sub {
325324
.sidebar {
326325
width: 200px;
327326
overflow-y: scroll;
327+
position: sticky;
328+
min-width: 200px;
329+
height: 100vh;
328330
}
329331

330332
.rustdoc.source .sidebar {
331-
overflow-y: auto;
332-
min-width: 200px;
333-
height: 100vh;
333+
overflow: auto;
334334
}
335335

336336
.source .sidebar {
@@ -1675,10 +1675,8 @@ details.rustdoc-toggle[open] > summary.hideme::after {
16751675
}
16761676

16771677
main {
1678-
height: auto;
16791678
padding-left: 15px;
16801679
padding-top: 0px;
1681-
overflow-y: visible;
16821680
}
16831681

16841682
.rustdoc {
@@ -1704,6 +1702,15 @@ details.rustdoc-toggle[open] > summary.hideme::after {
17041702
z-index: 11;
17051703
}
17061704

1705+
.sidebar.mobile {
1706+
position: sticky !important;
1707+
top: 0;
1708+
left: 0;
1709+
width: 100%;
1710+
margin-left: 0;
1711+
background-color: rgba(0,0,0,0);
1712+
}
1713+
17071714
.sidebar > .location {
17081715
float: right;
17091716
margin: 0px;
@@ -1839,15 +1846,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
18391846
height: 50px;
18401847
}
18411848

1842-
.sidebar.mobile {
1843-
position: sticky;
1844-
top: 0;
1845-
left: 0;
1846-
width: 100%;
1847-
margin-left: 0;
1848-
background-color: rgba(0,0,0,0);
1849-
}
1850-
18511849
.show-it, .sidebar-elems:focus-within {
18521850
z-index: 2;
18531851
left: 0;

0 commit comments

Comments
 (0)