Skip to content

Commit 8966c52

Browse files
arusahniJoshua Nelson
authored and
Joshua Nelson
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 d3259fa commit 8966c52

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

templates/style/rustdoc.scss

+7-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,13 @@ div.rustdoc {
4748
}
4849

4950
@media (max-width: 700px) {
51+
margin-left: -2 * $padding-x; // offset the additional padding added by the parent containers
52+
width: calc(100% + #{4 * $padding-x});
53+
5054
&.mobile {
5155
top: $top-navbar-height;
56+
margin-left: 0; // since the sidebar is now fixed position, remove the padding workaround
57+
width: 100%;
5258

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

0 commit comments

Comments
 (0)