Shrink the sticky header sooner, and stop it toggling in a loop - #240
Merged
Merged
Conversation
The header shrank only after 100px of scrolling, and a single threshold meant the 25px the page lifts on shrinking could be handed back by scroll anchoring, re-crossing the bound and toggling the class repeatedly. The threshold to beat now depends on which state the header is in, so no correction can reach the other bound, and the handler runs once per animation frame on a passive listener. Mobile and desktop share one path; the mobile header no longer grows back mid-page on an upward scroll. max-height had no length to animate from, so the shrink snapped rather than eased; the base rules now set one, and the transitions name the properties that actually change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011rCHPCdbV5C5dDJjEmMDuy
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.
Related to #
Proposed changes
Why are these changes being made?
max-heighthad no starting length to animate from, so the size jumped while only padding eased. Below 1200px the padding matches in both states, so nothing animated at all.Testing instructions
🤖 Generated with Claude Code
https://claude.ai/code/session_011rCHPCdbV5C5dDJjEmMDuy