Skip to content

fix(layout): keep sticky content below the environment banner - #1009

Merged
jacobvjk merged 1 commit into
mainfrom
fix/env-banner-overlap
Oct 26, 2026
Merged

jacobvjk merged 1 commit into
mainfrom
fix/env-banner-overlap

Conversation

@jacobvjk

Copy link
Copy Markdown
Collaborator

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 search and filters bar on /pathway
  • the pathway summary cards on /compare
  • the "On this page" index on the Resources and Contact pages (only 4px clear of the banner)

The banner still sticks; everything else now sticks just below it.

How

  • src/index.css: a CSS variable, --env-banner-height, is 1.75rem while the banner is on the page and 0px otherwise (:root:has([data-env-banner])). scroll-padding-top uses it, so headings reached from the index or a #link land below the banner.
  • EnvironmentBanner: marked with data-env-banner and takes its height from the variable. 28px, the same as before, so it looks unchanged.
  • The three sticky elements offset their top by 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.
  • A --mode main build contains every new rule (top-(--env-banner-height), h-(--env-banner-height), the xl:top-[calc(…)] index offset, the :has rule and scroll-padding-top).
  • Not yet checked in a browser. To check: npx vite --mode main, then scroll on /pathway and /compare, and on /resources/methodology at ≥1280px click an index entry. Each should stay fully visible below the banner.

🤖 Generated with Claude Code

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>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 09:33
@github-actions

Copy link
Copy Markdown

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

  • layout: keep sticky content below the environment banner (9c69a0f)

Build System

  • deps-dev: bump handlebars from 4.7.9 to 4.7.10 (56184e4)
  • deps: bump source-map-js from 1.2.1 to 1.2.2 (f2bfad1)
  • deps: bump the minor-and-patch group with 10 updates (4cc2f3e)
  • deps: bump the minor-and-patch group with 9 updates (0f96b16)

@github-actions

Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://proud-glacier-0f640931e-1009.westus2.2.azurestaticapps.net

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@jacobvjk
jacobvjk requested a review from AlexAxthelm October 26, 2026 09:36

@AlexAxthelm AlexAxthelm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better!

@jacobvjk
jacobvjk merged commit 686d119 into main Oct 26, 2026
12 checks passed
@jacobvjk
jacobvjk deleted the fix/env-banner-overlap branch October 26, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants