Make navigation always sticky, remove headroom.js#1356
Open
slightlyoffbeat wants to merge 1 commit into
Open
Conversation
The nav was using headroom.js to hide on scroll-down and reappear on scroll-up. We're switching to a permanently-pinned nav The "scrolled past top" state (used for a subtle drop-shadow under the nav) is now detected with a 1px sentinel element + IntersectionObserver instead of headroom's scroll listener (same visual, no library). Also: - Add `scroll-padding-block-start` so in-page anchor links account for the sticky nav. - Disable the shadow transition under `prefers-reduced-motion`. - Remove now-dead `body:has(.fl-landing-get) .headroom-unpinned` override. - Drop headroom.js dependency.
janriokrause
approved these changes
May 15, 2026
Contributor
janriokrause
left a comment
There was a problem hiding this comment.
r+ Looks good to me!
Nice touch adding scroll-padding-* to avoid anchor jump under the sticky header, and honoring prefers-reduced-motion ✨
If we want to support very old browsers, we could consider a lightweight fallback like always add is-scrolled or use a simple scroll listener when IntersectionObserver is unavailable. But I think it's fine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nav was using headroom.js to hide on scroll-down and reappear on scroll-up. We're switching to a permanently-pinned nav
The "scrolled past top" state (used for a subtle drop-shadow under the nav) is now detected with a 1px sentinel element + IntersectionObserver instead of headroom's scroll listener (same visual, no library).
Also:
scroll-padding-block-startso in-page anchor links account for the sticky nav.prefers-reduced-motion.body:has(.fl-landing-get) .headroom-unpinnedoverride.Saves about 5kb in bundle