docs(nav): pill header docks flush to the viewport top on scroll - #184
Merged
Merged
Conversation
The floating pill kept its 24px gap above it while scrolling because the offset lived inside the sticky #navbar. Move the offset onto #navbar itself: a sticky box docks by its border edge, so the margin scrolls away with the page and the pill sits flush against the top of the viewport once the page has scrolled 24px. At rest nothing changes. #navbar cannot query its own width, so its parent (which it fills edge to edge) becomes the query container for that one rule. The two-row layout below 1440px is untouched, and Mintlify derives --scroll-mt from the 84px navbar height, so anchored headings keep their clearance.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Takaros999
approved these changes
Sep 16, 2026
Takaros999
left a comment
Contributor
There was a problem hiding this comment.
Approved: focused CSS-only navbar docking fix; current checks are green.
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.
Summary
On desktop (≥1440px) the floating pill header kept a 24px gap above it while scrolling. The pill now rides up with the page and docks flush against the top of the viewport once the page has scrolled 24px. At rest the header is unchanged.
Why the gap existed
The 24px offset was a top margin on the pill inside the sticky
#navbar. A sticky element never scrolls, so its inner margin never scrolled away either.How it is fixed (pure CSS)
#navbaritself. A sticky box docks by its border edge, so the margin scrolls away with the page: 24px gap at rest, 0 once scrolled ≥24px.#navbarcannot query its own width, so its parent (which it fills edge to edge) becomes the query container for that one rule viadiv:has(> #navbar) { container-type: inline-size }. Both cross 1440px together, so docking follows the pill exactly, including when the hosted assistant panel narrows the page.Verified locally with
mint dev--scroll-mtfrom the navbar height (148px → 124px), so anchored headings keep their 40px clearance below the docked header.Design note
The pill keeps its rounded corners and hairline border when docked. Squaring the top corners in the docked state would need a small script, since CSS has no hook for the "stuck" state. Happy to follow up if design wants that.