Repository navigation
fix(layout): keep sticky content below the environment banner - #1009
Merged
Merged
Conversation
On non-production builds the environment banner sticks to the top of the screen, and so did the pathway search bar, the comparison page's summary cards and the "On this page" index. Once scrolled, they slid under the banner and lost their top 28px. * A CSS variable, --env-banner-height, is the banner's height while it is on the page and 0 otherwise. The banner takes its height from it and the three sticky elements offset by it. * scroll-padding-top uses it too, so headings reached from the index or a #link land below the banner. Production shows no banner, so its layout is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Expected version change and release notes:1.17.0-dev.10 (v1.17.0-dev.9...fix/env-banner-overlap ) (2026-10-26T09:34 UTC)Fixes
Build System |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-1009.westus2.2.azurestaticapps.net |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The shared offsets are consistent and no blocking issues were identified, though browser verification remains outstanding.
No open issues 🎉
What changed in this PR
This PR keeps sticky page content below the environment banner on staging and preview deployments, while preserving production offsets when no banner is present.
Changes:
- Adds a shared banner-height variable and banner-aware anchor scrolling.
- Uses the shared height for the banner and offsets the three affected sticky elements.
- Updates the page-index comment to describe the adjusted heading landing position.
| File | Description |
|---|---|
src/pages/PathwaySearch.tsx |
Offsets the sticky search and filters bar below the banner. |
src/pages/ComparisonPage.tsx |
Offsets sticky pathway summary cards below the banner. |
src/index.css |
Defines conditional banner height and scroll padding. |
src/components/OnPageIndex.tsx |
Adjusts the sticky index offset and explanatory comment. |
src/components/EnvironmentBanner.tsx |
Marks the banner and applies the shared height. |
Review effort: Balanced
This was referenced Oct 26, 2026
Draft
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.
On staging and PR previews, the environment banner ("MAIN Environment", "PR-123 Environment", …) sticks to the top of the screen. Three other parts of the site also stick to the top, so once you scroll they slide under the banner and their top ~28px is hidden:
The banner still sticks; everything else now sticks just below it.
How
src/index.css: a CSS variable,--env-banner-height, is1.75remwhile the banner is on the page and0pxotherwise (:root:has([data-env-banner])).scroll-padding-topuses it, so headings reached from the index or a#linkland below the banner.EnvironmentBanner: marked withdata-env-bannerand takes its height from the variable. 28px, the same as before, so it looks unchanged.topby the variable.Production has no banner, so the variable is 0 and production layout is unchanged.
Checks
npx vitest run: 552 passing. Lint and Prettier clean on the changed files.--mode mainbuild contains every new rule (top-(--env-banner-height),h-(--env-banner-height), thexl:top-[calc(…)]index offset, the:hasrule andscroll-padding-top).npx vite --mode main, then scroll on/pathwayand/compare, and on/resources/methodologyat ≥1280px click an index entry. Each should stay fully visible below the banner.🤖 Generated with Claude Code