Header
Native controls work. Demo links and submissions stay inside this specimen. This example scrolls horizontally at this width.
Source markup
<!-- @dsCard group="Navigation" height=152 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Header</title>
<style>
/* Layout of the demo state only. Every component value comes from bundle.css. */
.demo {
display: flex;
flex-direction: column;
gap: var(--space-3xs);
max-width: 960px; /* the card's layout width */
}
.demo__label {
padding-inline: var(--space-sm);
color: var(--color-semantic-text-muted);
}
.demo__stage {
position: relative; /* .hero__bg positions against this */
overflow: hidden;
padding-bottom: var(--space-lg); /* a strip of bare hero grid below the bar */
}
/* The hero grid and glow are masked to bloom at the very top of a full-height
hero, which this crop would hide entirely behind the bar. Sliding the layer
down puts that bloom across the bar's lower edge, so the backdrop blur has
something to act on and the crisp grid below it can be compared. */
.demo__stage .hero__bg {
top: var(--space-xl);
bottom: calc(-1 * var(--space-2xl));
}
/* The card frame is narrower than the header's 992px breakpoint, so bundle.css
would collapse the nav behind the burger and leave the bar empty. .is-desktop
re-applies the header's own desktop declarations, copied from bundle.css. */
.is-desktop .site-nav {
position: static;
flex-direction: row;
align-items: center;
gap: var(--space-lg);
padding-inline: 0;
background: transparent;
border-bottom: 0;
max-height: none;
overflow: visible;
visibility: visible;
}
.is-desktop .site-nav__list {
flex-direction: row;
align-items: center;
gap: var(--space-md);
}
.is-desktop .site-nav__list .nav-item {
width: auto;
min-height: auto;
padding-block: var(--space-2xs);
border-bottom: 0;
}
.is-desktop .site-nav__cta { margin-block: 0; }
/* bundle.css shows the burger only below 992px; the pinned desktop layout
hides it again so the flex row matches a wide viewport. */
.is-desktop .nav-burger { display: none; }
/* Above 992px the bar has room and the mark keeps its ratio; pinned into a
narrower frame the flex row would shrink and squash it. */
.is-desktop .logo,
.is-desktop .site-nav { flex-shrink: 0; }
</style>
</head>
<body>
<div class="demo">
<p class="label t-label demo__label">Sticky bar over the hero grid</p>
<div class="demo__stage is-desktop">
<div class="hero__bg" aria-hidden="true"></div>
<header class="site-header">
<div class="container site-header__inner">
<a class="logo" href="#home" aria-label="Noiz, home">
<svg class="logo__mark" xmlns="http://www.w3.org/2000/svg" width="584" height="191.55" viewBox="0 0 584 191.55" role="img" aria-hidden="true" focusable="false">
<g fill="currentColor">
<path fill-rule="evenodd" d="M 334.789062 96.386719 C 334.800781 61.859375 307.257812 34.445312 272.664062 34.558594 C 238.535156 34.667969 211.011719 62.320312 211.007812 96.503906 C 211 130.792969 238.351562 158.058594 272.785156 158.089844 C 307.800781 158.121094 334.78125 131.273438 334.789062 96.386719 M 272.699219 14.078125 C 319.066406 14.0625 355.601562 50.597656 355.53125 96.914062 C 355.464844 142.421875 318.617188 178.882812 272.757812 178.828125 C 227.105469 178.777344 190.28125 141.996094 190.308594 96.464844 C 190.332031 50.972656 227.210938 14.09375 272.699219 14.078125 "/>
<path fill-rule="evenodd" d="M 17.511719 12.273438 C 40.492188 35.015625 63.335938 57.625 86.238281 80.292969 C 81.835938 84.601562 77.535156 88.8125 73.011719 93.238281 C 61.398438 81.699219 49.582031 69.960938 36.953125 57.417969 L 36.953125 174.546875 L 17.511719 174.546875 Z M 17.511719 12.273438 "/>
<path fill-rule="evenodd" d="M 110.070312 106.789062 C 113.332031 103.574219 117.460938 99.5 121.675781 95.339844 C 133.464844 107.042969 145.273438 118.773438 157.960938 131.371094 L 157.960938 14.3125 L 177.832031 14.3125 L 177.832031 175.253906 C 155.675781 152.867188 133.050781 130.007812 110.070312 106.789062 "/>
<path fill-rule="evenodd" d="M 522.183594 34.296875 L 405.421875 34.296875 L 405.421875 14.503906 L 566.488281 14.503906 C 544.179688 36.796875 521.402344 59.558594 498.320312 82.621094 C 495.023438 79.070312 490.992188 74.722656 486.167969 69.519531 C 497.707031 58.234375 509.628906 46.574219 522.183594 34.296875 "/>
<path fill-rule="evenodd" d="M 404.539062 174.679688 C 426.695312 151.847656 449.078125 128.777344 471.976562 105.179688 C 476.433594 110.246094 480.367188 114.722656 484.730469 119.683594 C 473.34375 130.898438 461.328125 142.734375 448.332031 155.539062 L 565.804688 155.539062 L 565.804688 174.679688 Z M 404.539062 174.679688 "/>
<path fill-rule="evenodd" d="M 391.21875 174.554688 L 370.609375 174.554688 L 370.609375 14.558594 L 391.21875 14.558594 Z M 391.21875 174.554688 "/>
<path fill-rule="evenodd" d="M 284.675781 96.941406 C 284.632812 103.660156 278.992188 109.199219 272.164062 109.226562 C 265.429688 109.257812 259.832031 103.597656 259.867188 96.796875 C 259.902344 90.195312 265.289062 84.933594 272.050781 84.902344 C 279.097656 84.863281 284.714844 90.226562 284.675781 96.941406 "/>
</g>
</svg>
</a>
<input class="nav-toggle" type="checkbox" id="site-nav-toggle"
aria-label="Open menu" aria-expanded="false" aria-controls="site-nav-panel">
<label class="nav-burger" for="site-nav-toggle">
<svg class="nav-burger__open" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"/></svg>
<svg class="nav-burger__close" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 256 256" aria-hidden="true" focusable="false"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>
</label>
<nav class="site-nav" id="site-nav-panel" aria-label="Primary">
<ul class="site-nav__list">
<li><a class="nav-item" href="#hosting">Hosting</a></li>
<li><a class="nav-item" href="#cybersecurity" aria-current="page">Cybersecurity</a></li>
<li><a class="nav-item" href="#software">Software</a></li>
<li><a class="nav-item" href="#journal">Journal</a></li>
</ul>
<a class="btn btn--primary site-nav__cta" href="#contact">Get in touch</a>
</nav>
</div>
</header>
</div>
</div>
</body>
</html>
The sticky translucent bar holding the wordmark, the primary navigation and one call to action.
When to use
Section titled “When to use”Once per page, directly after the skip link. It is the only sticky chrome, at z-index: 100. For an in-page title block use PageHeader. It takes no pillar scope class, keeping color-semantic-accent-primary on a pillar page.
What the consumer provides
Section titled “What the consumer provides”A <header class="site-header"> around .container.site-header__inner: a .logo anchor wrapping .logo__mark (height: 3.3rem), then a .site-nav of .nav-item anchors in a .site-nav__list, plus one .btn.btn--primary.site-nav__cta. Mark the current page aria-current="page". Below 992px bundle.css collapses .site-nav behind the .nav-toggle checkbox and .nav-burger label, so render both; this card pins the desktop row.
States and tokens
Section titled “States and tokens”The bar is color-mix(in srgb, var(--color-semantic-bg-primary) 85%, transparent) over backdrop-filter: blur(var(--effect-blur-backdrop)), falling back to plain color-semantic-bg-primary. Keep that mix exact: color-glass-surface and color-glass-raised follow it. Its bottom edge is color-semantic-border-base at border-width-hairline.
A resting .nav-item is color-semantic-text-secondary, underline scaled to nothing; hover, :focus-visible and aria-current="page" take it to color-semantic-accent-primary, scaling the underline in over duration-base. The CTA fills color-semantic-accent-primary under color-semantic-text-on-accent, moving on hover to color-semantic-accent-hover with shadow-ring-amber and shadow-glow-amber. Keyboard focus is shadow-focus-ring.
Do and do not
Section titled “Do and do not”The wordmark is color-mark-light, never the ink ramp and never tinted. Do not swap color-semantic-text-on-accent for white on the CTA, or put shadow-glow-amber on the bar: that budget is the CTA’s. Never set a nav item in color-semantic-text-faint; it fails AA at font-scale-sm.
Accessibility
Section titled “Accessibility”- Role: native
<header>for the banner landmark and<nav aria-label="Primary">over a<ul>of links; no ARIA role added. - Name: the logo anchor takes
aria-label="Noiz, home", its inline<svg>aria-hidden="true"; the.nav-toggleburger takesaria-label="Open menu"andaria-controlsnaming the.site-navid. Itsaria-expanded="false"is a placeholder the consumer must script: a CSS-only checkbox cannot update it. - Keyboard: Tab reaches the logo, the burger below 992px, each
.nav-itemand the CTA; Enter follows a link, Space toggles the burger. No arrows, no Escape..nav-toggleisdisplay: noneabove 992px, so no phantom stop, and a collapsed.site-navisvisibility: hidden, so its links leave the tab order. - Target size:
.nav-burgeris 44px square,.btnsetsmin-height: 44px, a mobile.nav-item48px, a desktop.nav-itemabout 36px (font-scale-smline box plusspace-2xs), all clearing the 24px of WCAG 2.2 SC 2.5.8. - Live region: none. The script updating
aria-expandedannounces the open state.
Hand-written from themes/noiz/assets/css/components.css.