Skip to content

Commit

Permalink
Adjust sidebar nav sizing to account for rustdoc container padding.
Browse files Browse the repository at this point in the history
This addresses some visible jank caused by the sidebar nav container
overflow changing the rendered size.
  • Loading branch information
arusahni authored and Joshua Nelson committed Jan 1, 2021
1 parent d3259fa commit 8966c52
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion templates/style/rustdoc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -47,8 +48,13 @@ 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: 45px + $top-navbar-height;
Expand Down

0 comments on commit 8966c52

Please sign in to comment.