Skip to content

Switch to position: sticky and rely on scroll-padding-top #1595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jsha opened this issue Jan 16, 2022 · 0 comments
Open

Switch to position: sticky and rely on scroll-padding-top #1595

jsha opened this issue Jan 16, 2022 · 0 comments

Comments

@jsha
Copy link
Contributor

jsha commented Jan 16, 2022

PR #873 added the scroll-padding-top property to ensure the topbar wouldn't cover body content. It also added a JS workaround because scroll-padding-top was not yet supported on latest Safari. Now it is. I propose to remove the JS workaround. That will also fix #1334.

Also, there's a newer alternative to position: sticky: position: fixed: https://developer.mozilla.org/en-US/docs/Web/CSS/position. It's available on all our supported browsers. The difference is that a position: sticky element participates in the DOM layout, and then transitions to fixed position once you scroll far enough. This makes it less fragile to layout the items below the sticky one, since you don't have to give everything a top offset. I propose to switch to position: sticky for the topbar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant