Skip to content

Commit 79b720f

Browse files
jshasyphar
authored andcommitted
Switch from position: fixed to sticky
This allows us to remove `padding-top: $top-navbar-height !important` on body. Also, remove an obsolete workaround for older Chrome browsers to put scroll-padding-top on `body` rather than `html`.
1 parent 1bff554 commit 79b720f

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

templates/style/_navbar.scss

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ div.nav-container {
1515
left: 0;
1616
right: 0;
1717
top: 0;
18-
position: fixed;
18+
position: sticky;
1919
color: var(--color-navbar-standard);
2020
font-family: $font-family-sans;
2121

@@ -288,17 +288,6 @@ div.nav-container {
288288
color: var(--color-navbar-standard);
289289
}
290290

291-
body {
292-
// Since top navbar is fixed, we need to add padding to the body content.
293-
padding-top: $top-navbar-height !important;
294-
295-
// The scroll padding on the <body> is necessary for Chrome
296-
// browsers for now (see
297-
// https://css-tricks.com/fixed-headers-on-page-links-and-overlapping-content-oh-my/
298-
// for an explanation)
299-
scroll-padding-top: $top-navbar-height;
300-
}
301-
302291
html {
303292
// Offset anchor jump targets down by this much, so they don't
304293
// overlap the top navigation bar (not supported on Desktop/Mobile

0 commit comments

Comments
 (0)