Skip to content

Commit

Permalink
rustdoc: don't use overflow for main, instead make the sidebar sticky
Browse files Browse the repository at this point in the history
  • Loading branch information
cynecx authored and GuillaumeGomez committed Nov 29, 2021
1 parent e2467f2 commit cad0fce
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1675,10 +1675,8 @@ details.rustdoc-toggle[open] > summary.hideme::after {
}

main {
height: auto;
padding-left: 15px;
padding-top: 0px;
overflow-y: visible;
}

.rustdoc {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit cad0fce

Please sign in to comment.