Skip to content

Show the site-wide banner at the top of the docs - #302

Merged
alcuadrado merged 1 commit into
mainfrom
docs-banner
Sep 9, 2026
Merged

alcuadrado merged 1 commit into
mainfrom
docs-banner

Conversation

@fzeoli

@fzeoli fzeoli commented Sep 9, 2026

Copy link
Copy Markdown
Member

Stacked on #301 (banner text/link update). Retarget to main once that merges.

What

Adds the same top banner the landing page has to every docs page, above the Starlight header.

  • Shared component and config. Banner.astro moves to src/components/ui/ and reads a new top-level banner entry in src/config.ts, used by both the landing and the docs. Positioning is left to the parent: the landing keeps it sticky, the docs render it inside Starlight's fixed header.
  • Docs layout. Starlight offsets the sidebar, main frame, mobile TOC, right sidebar and anchor scroll padding from --sl-nav-height. The custom theme CSS adds --hh-docs-banner-height (40px) to that variable, so everything clears the banner with no per-component changes. Only the site title logo and the mobile menu button, which center themselves within the header height, subtract it again.
  • Font. The docs don't load the landing fonts, so the banner falls back to Starlight's monospace stack there. Weight lowered from 600 to 500 on both.

Testing

Measured and screenshotted at 375, 768, 1200 and 1440px in light and dark: banner at 0–40px, header grown by exactly 40, logo at its original size, menu button centered in the nav strip, sidebar pane and mobile TOC starting at the header's bottom edge, mobile menu opening below the header, anchor links landing with the same clearance as before, landing banner still sticky. astro check, spellcheck, tests and prettier pass.

🤖 Generated with Claude Code

The landing banner is now shared: Banner.astro moves to components/ui and
reads a top-level `banner` config entry used by both the landing and the
docs, so the text and link are updated in one place. Positioning is left
to the parent: the landing keeps it sticky, and the docs render it inside
Starlight's fixed header.

Starlight offsets the sidebar, main frame, mobile TOC, right sidebar and
scroll padding from --sl-nav-height, so the docs reserve room for the
banner by adding --hh-docs-banner-height to that variable. Only the site
title logo and the mobile menu button, which center themselves within
the header height, subtract it again.

The docs don't load the landing fonts, so the banner falls back to
Starlight's monospace stack there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hardhat-website Ready Ready Preview Sep 9, 2026 4:29pm UTC

Request Review

Base automatically changed from banner-slang-solx to main September 9, 2026 18:19
@alcuadrado
alcuadrado added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 085ff94 Sep 9, 2026
3 checks passed
@alcuadrado
alcuadrado deleted the docs-banner branch September 9, 2026 18:42

This branch was successfully deployed

1 active deployment
Preview — 1056d0be Deployed Sep 9, 2026 by vercel[bot]
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.

2 participants