Welcome to Vanilla Breeze
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
This bell pulls live notifications from /go/notify/messages — the same contract documented at /docs/concepts/service-contracts/. Static articles like this one are the no-JS / no-backend fallback.
Hero section patterns for landing pages and marketing sites. Centered text, split layouts, background images, forms, and video backgrounds.
Hero sections are the first thing visitors see on a landing page. These patterns use <layout-cover> for vertical centering and <layout-center> for horizontal alignment, creating responsive layouts without media queries.
Key features:
layout-coverdata-layout-minThe simplest hero pattern: centered headline, lead text, and call-to-action buttons. Perfect for product launches and announcements.
<section class="hero"> <layout-cover data-layout-min="70vh" data-layout-padding="xl"> <layout-center data-layout-max="normal"> <layout-stack data-layout-gap="l" class="hero-content"> <h1>Ship faster with less code</h1> <p class="lead"> Vanilla Breeze is a lightweight CSS framework built on modern standards. Semantic HTML, custom elements, and design tokens. No build step required. </p> <nav> <ul data-layout="cluster" data-layout-justify="center" data-layout-gap="m"> <li><a href="/get-started/" class="button large">Get Started</a></li> <li><a href="/docs/" class="button large secondary">Documentation</a></li> </ul> </nav> </layout-stack> </layout-center> </layout-cover></section>
Text on one side, image on the other. Uses layout-sidebar for a flexible two-column layout that stacks on narrow viewports.
<section class="hero"> <layout-cover data-layout-min="60vh" data-layout-padding="xl"> <layout-center data-layout-max="wide"> <layout-sidebar data-layout-gap="2xl" data-layout-sidebar-width="wide" data-layout-content-min="50"> <layout-stack data-layout-gap="l"> <layout-badge data-variant="success">Now Available</layout-badge> <h1>Build interfaces that scale</h1> <p> Start with semantic HTML and enhance with custom elements. Our layout primitives handle the complexity so you can focus on content. </p> <nav> <ul data-layout="cluster" data-layout-gap="m"> <li><a href="/get-started/" class="button">Start Building</a></li> <li><a href="/examples/" class="button ghost">View Examples</a></li> </ul> </nav> </layout-stack> <figure class="hero-image"> <img src="/images/hero-illustration.png" alt="Application interface mockup" width="600" height="450" loading="eager" /> </figure> </layout-sidebar> </layout-center> </layout-cover></section>
Full-width background image with a dark overlay for text readability. The overlay uses --color-overlay-strong from design tokens.
<section class="hero hero-with-bg"> <layout-cover data-layout-min="80vh" data-layout-padding="xl"> <layout-center data-layout-max="normal"> <layout-stack data-layout-gap="l" class="hero-content"> <h1>Experience the difference</h1> <p class="lead"> Immerse yourself in a new way of building for the web. Modern standards, timeless simplicity. </p> <nav> <ul data-layout="cluster" data-layout-justify="center" data-layout-gap="m"> <li><a href="/demo/" class="button large">Watch Demo</a></li> <li><a href="/pricing/" class="button large ghost">View Pricing</a></li> </ul> </nav> </layout-stack> </layout-center> </layout-cover></section>
Add these styles to support background images with overlay:
.hero-with-bg { background-image: url('/images/hero-bg.jpg'); background-size: cover; background-position: center; position: relative;} .hero-with-bg::before { content: ""; position: absolute; inset: 0; background: var(--color-overlay-strong);} .hero-with-bg > * { position: relative; color: var(--color-white);}
Hero with an embedded newsletter signup or registration form. Uses layout-sidebar to place content and form side by side.
<section class="hero"> <layout-cover data-layout-min="60vh" data-layout-padding="xl"> <layout-center data-layout-max="wide"> <layout-sidebar data-layout-gap="2xl" data-layout-sidebar-width="wide" data-layout-content-min="50"> <layout-stack data-layout-gap="l"> <h1>Stay in the loop</h1> <p class="lead"> Get the latest updates on new features, best practices, and community highlights delivered to your inbox. </p> <ul data-layout="cluster" data-layout-gap="s" class="checkmark-list"> <li><icon-wc name="check" size="sm"></icon-wc> Weekly digest</li> <li><icon-wc name="check" size="sm"></icon-wc> No spam</li> <li><icon-wc name="check" size="sm"></icon-wc> Unsubscribe anytime</li> </ul> </layout-stack> <layout-card data-variant="outlined"> <form action="/subscribe" method="POST" data-layout="stack" data-layout-gap="m"> <h2>Subscribe to our newsletter</h2> <form-field> <label for="name">Name</label> <input type="text" id="name" name="name" required autocomplete="name" placeholder="Your name" /> </form-field> <form-field> <label for="email">Email</label> <input type="email" id="email" name="email" required autocomplete="email" placeholder="[email protected]" /> </form-field> <button type="submit" class="full-width">Subscribe</button> <p class="text-sm text-muted"> By subscribing, you agree to our <a href="/privacy/">Privacy Policy</a>. </p> </form> </layout-card> </layout-sidebar> </layout-center> </layout-cover></section>
Hero with video background or an embedded video player. The video background version uses an overlay for text readability.
<section class="hero hero-video-bg"> <video autoplay muted loop playsinline poster="/images/video-poster.jpg"> <source src="/videos/hero-bg.mp4" type="video/mp4" /> </video> <layout-cover data-layout-min="80vh" data-layout-padding="xl"> <layout-center data-layout-max="normal"> <layout-stack data-layout-gap="l" class="hero-content"> <h1>See it in action</h1> <p class="lead"> Watch how teams are building faster with modern CSS. No frameworks, no complexity, just clean code. </p> <nav> <ul data-layout="cluster" data-layout-justify="center" data-layout-gap="m"> <li><a href="/demo/" class="button large">Play Full Video</a></li> <li><a href="/get-started/" class="button large ghost">Get Started</a></li> </ul> </nav> </layout-stack> </layout-center> </layout-cover></section>
Add these styles for the video background effect:
.hero-video-bg { position: relative; overflow: hidden;} .hero-video-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;} .hero-video-bg::before { content: ""; position: absolute; inset: 0; background: var(--color-overlay-strong); z-index: 1;} .hero-video-bg > *:not(video) { position: relative; z-index: 2; color: var(--color-white);}
Common data attributes for hero sections:
| Element | Attribute | Values | Description |
|---|---|---|---|
layout-cover |
data-layout-min |
CSS length (e.g., 50vh, 400px) |
Minimum height of the hero section. |
layout-cover |
data-layout-padding |
xs s m l xl 2xl |
Vertical padding inside the cover. |
layout-center |
data-layout-max |
narrow normal wide prose |
Maximum content width. |
layout-sidebar |
data-layout-sidebar-width |
narrow default wide |
Width of the sidebar column. |
layout-cluster |
data-layout-justify |
start center end between |
Horizontal alignment of buttons. |
vh units for viewport-relative heights. 70vh to 80vh works well for primary heroes.normal for centered text to maintain comfortable line lengths.data-layout="cluster" with data-layout-justify="center" for centered layouts, or default alignment for split layouts.loading="eager" for hero images since they're above the fold.--color-overlay-strong for dark overlays that ensure text readability.poster attribute and use muted with autoplay for background videos.Cover layout element documentation
Center layout element documentation
Sidebar layout element documentation
CTA section patterns