diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 0ba082b1cd78b..b5c90db924666 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -257,8 +257,7 @@ main {
position: relative;
flex-grow: 1;
padding: 10px 15px 40px 45px;
- height: 100vh;
- overflow-y: auto;
+ min-width: 0;
}
.source main {
@@ -325,12 +324,13 @@ nav.sub {
.sidebar {
width: 200px;
overflow-y: scroll;
+ position: sticky;
+ min-width: 200px;
+ height: 100vh;
}
.rustdoc.source .sidebar {
- overflow-y: auto;
- min-width: 200px;
- height: 100vh;
+ overflow: auto;
}
.source .sidebar {
@@ -1675,10 +1675,8 @@ details.rustdoc-toggle[open] > summary.hideme::after {
}
main {
- height: auto;
padding-left: 15px;
padding-top: 0px;
- overflow-y: visible;
}
.rustdoc {
@@ -1704,6 +1702,15 @@ details.rustdoc-toggle[open] > summary.hideme::after {
z-index: 11;
}
+ .sidebar.mobile {
+ position: sticky !important;
+ top: 0;
+ left: 0;
+ width: 100%;
+ margin-left: 0;
+ background-color: rgba(0,0,0,0);
+ }
+
.sidebar > .location {
float: right;
margin: 0px;
@@ -1839,15 +1846,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
height: 50px;
}
- .sidebar.mobile {
- position: sticky;
- top: 0;
- left: 0;
- width: 100%;
- margin-left: 0;
- background-color: rgba(0,0,0,0);
- }
-
.show-it, .sidebar-elems:focus-within {
z-index: 2;
left: 0;