Skip to content

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

Open
@jsha

Description

@jsha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions