0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Build a marketing page for a made-up product: a header with navigation, a hero with two calls to action, a features grid, three pricing plans and a footer. You'll write the HTML first, then add layout, then cards.
About 15 minutes · Uses layers 1–3: semantic HTML, data-* attributes, CSS-only custom elements · No JavaScript
The finished page. It loads one stylesheet and no script.
Before you start
Make a folder, and in it one file called index.html with this in it. Open the file in a browser and keep it open: after each step, save and reload.
index.html
<!doctype html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1"><title>Relay: one inbox for your support team</title><linkrel="stylesheet"href="https://unpkg.com/vanilla-breeze/dist/cdn/vanilla-breeze.css"></head><body><!-- Everything in this tutorial goes here --></body></html>
That is the whole setup: one stylesheet, always the newest release because the URL names no version. The other ways to install are in the Quick Start.
There is no <script> tag. In this series the script is added only in the step that needs it, and this page never reaches that step.
Step 1 — Write the page in semantic HTML
Start with the content and say what each part is. The page has a <header> holding the brand and a <nav>, a <main> with three <section>s, and a <footer>. Each section is named by its heading through aria-labelledby, so a screen reader lists "Why teams switch to Relay" and "Pricing" as regions to jump to.
The features and the plans are both lists, so they are <ul>s: three features, three plans. Choosing a list now matters later, because the list is the element that will become the grid. You will not need to add a wrapper to get columns.
The calls to action are links, not buttons. They take the visitor somewhere, and that is what <a> is for. The #signup, #privacy and #terms targets are placeholders: point them at your real pages.
The stylesheet has set the typeface, the heading sizes and the link colours. Lists inside a <nav> have lost their bullets; the feature and plan lists still have them.
Nothing is arranged. Every element sits under the one before it, and the text runs to the edge of the window. That is correct for now: the stylesheet does not guess a layout.
Features and Pricing in the header scroll to their sections. The page already works.
Step 2 — Arrange it with data-* attributes
Layout in Vanilla Breeze is an attribute on an element you already have. This step adds no elements and removes none. It uses four values of data-layout:
center on each section: a centered column with a maximum width and a gutter at the sides. data-layout-gap spaces its children, and on the hero data-layout-text centers the text too.
grid on the two lists: as many columns as fit at a minimum width (data-layout-min="m" is 15rem), with no breakpoints to write.
cluster on the navigation lists, the pair of hero links and the footer: a row that wraps when it runs out of room.
stack on each list item: an even vertical gap between the heading, the text and the link.
Two more attributes do one job each. data-padding on a section gives it space above and below that shrinks on small screens. data-marker="check" on a plan's list swaps the bullets for check marks.
The rest are classes. Vanilla Breeze has no utility classes, but it does have a few variant classes that say which kind of thing an element is, and this step uses five: site on the header and footer (the site-wide ones, padded and ruled off), lead on the intro paragraph, button and secondary on the calls to action, and unstyled on the two grid lists to drop their bullets. header.site already puts the brand and the navigation at opposite ends, so the header needs no layout attribute of its own.
The header has the brand at one end and the navigation at the other. The hero is centered, with one solid and one outlined button.
Features and plans sit three across. Narrow the window: they drop to two columns, then one, and nothing overflows.
Only the Team plan has a solid button. That is the one you want visitors to pick, and so far the button is the only thing saying so.
Step 3 — Add custom elements for the cards
The page is laid out, but the plans are three loose columns of text. A visitor comparing prices needs to see where one plan ends and the next begins. That is a surface: a border or a shadow, a corner radius, padding. No attribute on an <li> gives you one, so this is the point to reach for a custom element.
<layout-card> is that surface. It is styled by the stylesheet you already load and has no JavaScript behind it. Wrap the content of every feature and plan <li> in one, and move the two stack attributes from the <li> to the card, since the card is now the box that holds the heading, text and link. The list stays a list.
Use data-variant="outlined" everywhere except the Team plan, which gets elevated: a shadow in place of the border, so the recommended plan stands a little forward. Then replace the <small> beside "Team" with a <layout-badge>, the second CSS-only element.
Step 3: one feature and the Team plan
<!-- Each feature --><li><layout-carddata-variant="outlined"data-padding="l"data-layout="stack"data-layout-gap="xs"><h3>Shared queue</h3><p>Every message lands in one list. Assign it, snooze it or close it, and everyone can see who has what.</p></layout-card></li><!-- Starter and Business use data-variant="outlined"; Team is elevated --><li><layout-carddata-variant="elevated"data-padding="l"data-layout="stack"data-layout-gap="s"><h3>Team <layout-badgedata-color="primary"data-variant="subtle">Most popular</layout-badge></h3><p><strong>$12</strong> per teammate, per month</p><uldata-marker="check"><li>Five mailboxes</li><li>Unlimited history</li><li>Chat support</li></ul><aclass="button"href="#signup">Try Team free</a></layout-card></li>
What changed
Six cards. The cards in a row are the same height, because a card that is alone in a grid list item fills it.
The Team plan has a shadow and a "Most popular" badge; the other two have a border.
Switch your system to dark mode. Borders, surfaces, the badge and the buttons all change with it, and you have written no CSS.
Step 4 — Web components: none needed
The fourth layer is web components: elements with JavaScript behind them, such as tabs, a sortable table or a toast. Before adding one, ask a single question: does this page need behaviour that HTML and CSS cannot provide?
Go through what the page does. The navigation and the calls to action are links. Jumping to a section is a link to an id. The columns reflow through CSS, and so do hover, focus and dark mode. Nothing on the page opens, sorts, filters, validates or updates after it has loaded. The answer is no, so the page stops at layer three and index.html never gets a <script> tag.
That is a result, not a shortcut. The page has nothing to download and run before it works, and nothing that can fail to load. The question would come out differently if you added a monthly/annual price switch, a navigation menu too long to fit a phone, or a sign-up form that reports errors as you type. Later tutorials in this series reach that point.
The finished page at phone width: the step 3 markup, unchanged.
Check
Turn JavaScript off in your browser and reload. Nothing changes.
Open the network panel and reload. There is no script in the list.
What you learned
Pick elements for what the content is. A list of plans as a <ul> became a grid without a wrapper.
data-layout arranges an existing element: center for a column, grid for columns that reflow, cluster for a wrapping row, stack for vertical spacing.
There are no utility classes, only a few variant classes that name a kind of element: site, lead, button, secondary, unstyled.
CSS-only custom elements such as <layout-card> and <layout-badge> add a surface when no attribute will. They need no script.
Web components are for behaviour HTML and CSS cannot provide. When a page has none, leave the script out.
Try it yourself
Add a questions section. After Pricing, add a section with three <details name="faq"> elements. Sharing a name makes the browser close one when another opens, still with no script. Read details.
Keep the header in view. Add data-sticky to the <header> and scroll. Read header.
Change the look. Add data-theme="modern" to the <html> tag; it is one of the themes bundled in the stylesheet. Read Themes.