Skip to content

Commit a538244

Browse files
committed
Adjust sidebar nav sizing to account for rustdoc container padding.
This addresses some visible jank caused by the sidebar nav container overflow changing the rendered size.
1 parent 53ab36a commit a538244

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/style/rustdoc.scss

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ body.blur {
2929

3030
// rustdoc overrides
3131
div.rustdoc {
32+
$padding-x: 15px;
3233
font-family: $font-family-serif;
33-
padding: 10px 15px 20px 15px;
34+
padding: 10px $padding-x 20px;
3435
position: relative;
3536

3637
@media (max-width: 700px) {
@@ -47,8 +48,12 @@ div.rustdoc {
4748
}
4849

4950
@media (max-width: 700px) {
51+
margin-left: -2 * $padding-x; // offset the additional padding added by the parent container
52+
width: 100vw; // fill the viewport
53+
5054
&.mobile {
5155
top: $top-navbar-height;
56+
margin-left: 0; // since the sidebar is now fixed position, remove the padding workaround
5257

5358
.sidebar-elems.show-it {
5459
top: 45px + $top-navbar-height;

0 commit comments

Comments
 (0)