index2.html: fix fixed navbar overlapping hero content on mobile#116
Merged
Conversation
On narrow screens the fixed top header switches to a stacked column layout and the nav links wrap to several rows, so the header grows to ~170px tall — well past the hero's fixed 6rem top padding. With the hero content vertically centered, the logo and title ended up hidden behind the navbar (reported in discussion #9768). Offset the hero's top padding by the measured header height (--header-h, already set in JS) via max(6rem, --header-h + 1.5rem), so the content always clears the header. Desktop is unaffected: the header is shorter than 6rem there, so the 6rem value still wins. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
Reported in discussion #9768: on mobile the page title/logo is hidden behind the top nav bar, and scrolling up snaps back to it.
On narrow screens (
max-width: 640px) the fixedheader.topswitches to a stacked column layout and the nav links wrap to several rows, so the header grows to ~170px tall — well past the hero's fixed6rem(96px) top padding. Because the hero content is vertically centered, the logo andh1ended up sitting behind the fixed navbar.Fix
Offset the hero's top padding by the actual measured header height.
--header-his already computed in JS (used for sectionscroll-margin-top), so the hero now uses:6remvalue still wins — look unchanged.Verification
Tested locally with a browser preview:
🤖 Generated with Claude Code