Skip to content

Header

.bp-header is a position: sticky header with glassmorphism via @supports (backdrop-filter). The .is-scrolled class is toggled by an IntersectionObserver sentinel. Uses view-transition-name: bp-header for smooth cross-document transitions.

Header with logo, nav placeholder, and theme toggle

<style>
.demo-header { position: relative; }
.demo-header__nav { flex: 1; }
</style>
<header class="bp-header demo-header">
<div class="bp-header__inner">
<a href="/" class="bp-header__logo">Be Partner DS</a>
<nav class="demo-header__nav" aria-label="Main">
<!-- .bp-nav goes here -->
</nav>
<div class="bp-header__actions">
<button class="bp-btn bp-btn--secondary bp-btn--sm" type="button">Sign in</button>
<button class="bp-btn bp-btn--sm" type="button">Get started</button>
</div>
</div>
</header>

is-scrolled state (shadow active)

<style>
.demo-header { position: relative; }
</style>
<header class="bp-header is-scrolled demo-header">
<div class="bp-header__inner">
<a href="/" class="bp-header__logo">Be Partner DS</a>
<div class="bp-header__actions">
<button class="bp-btn bp-btn--sm" type="button">Get started</button>
</div>
</div>
</header>
<!-- Place immediately after the opening <body> tag -->
<div id="header-sentinel" aria-hidden="true" style="height:1px"></div>
<script type="module">
const sentinel = document.getElementById('header-sentinel')
const header = document.getElementById('site-header')
new IntersectionObserver(([entry]) => {
header.classList.toggle('is-scrolled', !entry.isIntersecting)
}).observe(sentinel)
</script>
VariableDefaultDescription
--header-bgvar(--bp-color-bg-elevated)Background / glassmorphism base
--header-height4remHeader height
--header-z100z-index
No axe violations tested 2026-05-11
  • <header> has an implicit banner landmark role.
  • The logo link should be the first focusable element.
  • Add a skip-to-content link before the header in DOM order.
APIAvailabilityUsed forWithout itPolyfill
backdrop-filter Widely available Baseline 2022 Glassmorphism blur behind the headerSolid opaque background, fully functionalNone needed; @supports guard in CSS
IntersectionObserver Widely available Baseline 2020 Toggle .is-scrolled shadow on scrollNo scroll-state shadow; use a scroll event listenerpolyfill
View Transitions API Newly available Baseline 2024 Smooth cross-document header animationInstant page transitions, header snapsNone needed
color-mix() Widely available Baseline 2023 Glassmorphism background tintSolid token color used insteadNone needed; @supports guard in CSS
Container Queries Widely available Baseline 2023 Actions area stacks at small header widthStatic horizontal layoutNone needed
  • --_bg, --_height, --_z — component-private, do not set directly.