From cad0fce2053d52b7ba04c458f4c124c8b5c6141e Mon Sep 17 00:00:00 2001 From: cynecx Date: Sun, 24 Oct 2021 20:03:13 +0200 Subject: [PATCH] rustdoc: don't use overflow for main, instead make the sidebar sticky --- src/librustdoc/html/static/css/rustdoc.css | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) 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;