Masthead
The site's top bar and its navigation behaviour, configured from site.chrome.
site.chrome says how the top bar looks and how its navigation behaves; the<Masthead> and <SiteNav> Astro components read it, and a prop overrides one field for one layout. It is pure CSS: no script runs for any variant below. The name is masthead, not header or banner — <header> is valid inside any section, and banner is the announcement bar and an ARIA landmark role.
Options
| Key | Values |
|---|---|
masthead.position | static · sticky · fixed (overlays the first section) |
masthead.states | atStart · atEnd · scrollingToEnd · scrollingToStart, each a partial look: layout, height, inset, surface, elevation (or false), hidden. Later states win; changes animate. |
masthead.surface | solid · glass · transparent |
masthead.layout | full · inset · floating |
masthead.elevation | shadow (a shadows key), border |
masthead.tone, width | a colour role (role:solid for a fill) · content | full |
masthead.height, masthead.inset | a CSS length, fluid allowed: 4rem, clamp(3.5rem, 8cqi, 4.5rem). inset is the gap to the viewport for inset/floating (default 0.75rem). cqi follows the page container, vw the viewport. |
nav.compact | drawer · dropdown |
nav.drawerSide, breakpoints, depths | start | end · sm…xl · 1–3 |
Browser support. Every states look usesscroll-state() container queries, which only ever take things away from a settled bar. Chromium gets all of it. A browser without them (Firefox today) shows the settled bar: solid, elevated and always visible — never a transparent one over the page. The effect appears on its own once the browser ships the feature. The bar never slides away while focus or an open menu is inside it.
Variants
Sticky glass, shadow once scrolled
"chrome": { "masthead": { "position": "sticky", "surface": "glass",
"elevation": { "shadow": "sm" },
"states": { "atStart": { "elevation": false } } } }Hide on scroll down, back on scroll up
"chrome": { "masthead": { "position": "sticky", "elevation": { "border": true },
"states": { "scrollingToEnd": { "hidden": true } } } }Floating, inset from the viewport
"chrome": { "masthead": { "position": "sticky", "surface": "glass",
"layout": "floating", "inset": "1.5rem", "height": "5rem",
"elevation": { "shadow": "sm" } } }Fluid height and inset (clamp + container units)
"chrome": { "masthead": { "position": "sticky", "surface": "glass",
"layout": "floating",
"height": "clamp(3.5rem, 8cqi, 4.5rem)",
"inset": "clamp(0.5rem, 3cqi, 2rem)" } }Transparent over a hero, solid once scrolled
"chrome": { "masthead": { "position": "fixed", "elevation": { "shadow": "sm" },
"states": { "atStart": { "surface": "transparent", "elevation": false } } } }Full-width banner at the top, floating once scrolled
"chrome": { "masthead": { "position": "fixed", "surface": "glass",
"layout": "floating", "height": "4rem", "elevation": { "shadow": "sm" },
"states": { "atStart": { "layout": "full", "height": "6rem",
"surface": "transparent", "elevation": false } } } }Compact dropdown (columnar panel under the toggle)
"chrome": { "masthead": { "position": "sticky" },
"nav": { "compact": "dropdown", "breakpoint": "xl" } }Mega menu (the primary-mega tier)
"chrome": { "masthead": { "position": "sticky", "elevation": { "border": true } },
"nav": { "megaBreakpoint": "lg" } }