diff --git a/templates/style/rustdoc.scss b/templates/style/rustdoc.scss index 4939b1cdc..2079d4349 100644 --- a/templates/style/rustdoc.scss +++ b/templates/style/rustdoc.scss @@ -29,8 +29,9 @@ body.blur { // rustdoc overrides div.rustdoc { + $padding-x: 15px; font-family: $font-family-serif; - padding: 10px 15px 20px 15px; + padding: 10px $padding-x 20px; position: relative; @media (max-width: 700px) { @@ -47,11 +48,16 @@ div.rustdoc { } @media (max-width: 700px) { + margin-left: -2 * $padding-x; // offset the additional padding added by the parent containers + width: calc(100% + #{4 * $padding-x}); + &.mobile { top: $top-navbar-height; + margin-left: 0; // since the sidebar is now fixed position, remove the padding workaround + width: 100%; - .sidebar-elems .show-it { - top: 77px; + .sidebar-elems.show-it { + top: 45px + $top-navbar-height; } #sidebar-filler {