Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

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…

Read the release notes

class

VB uses classes for named, element-scoped variants (button.secondary, nav.pills, header.site). State and configuration live in data-* attributes instead.

Overview

The class attribute is a space-separated list of names that CSS and scripts can select on. In Vanilla Breeze a class picks a named variant of one element: <button class="secondary">, <nav class="pills">, <header class="site">. VB does not ship appearance utilities such as .text-center or .mt-4.

Every variant is scoped to its element. .pills does something on <nav> and <menu> and nothing elsewhere; .compact means one thing on <header> and another on <article>.

Applies to: every element (it is a global attribute).

Values

ValueMeaning
Space-separated names, e.g. "site sticky"Each name is a class. Order and duplicates do not matter. Names are case-sensitive.
"" or absentNo classes. The element gets VB's default styling for its tag.

Classes or data attributes?

VB splits the work (see Principles: data attributes for configuration):

  • Class — a named variant that is either on or off: button.secondary, nav.tabs, footer.columns.
  • data-* attribute — configuration with a value, or state: data-layout="stack", data-density="compact", data-sticky, data-state.
  • ARIA or native attribute — state the browser or assistive technology must also know about: aria-current, aria-pressed, disabled, open. VB styles these directly. See ARIA states VB styles.

If you are looking for a class and cannot find it, look for a data-* attribute. These are attributes, not classes:

You wantWrite
A sticky header or footer<header data-sticky>, <footer data-sticky> (data-sticky)
Striped, bordered or compact tables<table data-striped data-bordered data-density="compact"> (table variants)
Pagination styles<nav class="pagination" data-variant="compact">
Horizontal description lists<dl data-variant="horizontal">
List markers<ul data-marker="arrow">
Layout (stack, cluster, grid, sidebar…)data-layout on any element

Examples

Button

Variants for <button>. a.button makes a link look like a button.

ClassEffect
.secondaryOutlined, transparent background
.ghostText only; a background appears on hover
.small, .largeSmaller or larger padding and type
.full-widthFills the available width

Navigation

Variants for <nav>. Put the links in a list; the current link is marked with aria-current, not a class.

ClassEffect
.horizontal, .verticalLay the list out in a row (wrapping) or a column
.pillsRounded filled background on the current item
.tabsTab bar with an underline on the current item
.minimalPlain text links
.breadcrumbTrail with separators (data-separator picks the glyph)
.paginationNumbered page links
.treeNested <details> tree
.stepsNumbered progress steps (current step: aria-current="step")

Forms

ClassOnEffect
.stacked, .inline, .gridformLabels above fields, a wrapping row, or a two-column grid
.actions (+ .end, .between)footer, or any element in a form or dialogButton row, optionally aligned to the end or spread out
.groupfieldset, or any element in a formColumn of related controls
.helpp, span, smallHelper text under a field
.hint, .erroroutput in <form-field>Hint and error messages, wired to aria-describedby

Header and footer

ElementClasses
<header>.site, .page, .card, .transparent, .centered, .compact
<footer>.site, .article, .card, .minimal, .columns

Lists

ClassOnEffect
.inlineul, olItems in a wrapping row, no markers
.unstyledul, olNo markers, no indent
.metaul, olInline metadata row (author, date, reading time)

Other element classes

The remaining element-scoped classes, from src/native-elements/*/styles.css. Each element page describes what they do.

ElementClasses
a.button
address.card, .compact, .contact, .footer, .inline
article.blog, .card, .compact, .feature, .nested
aside.float, .note, .sidebar, .sidenote
audio.compact, .minimal
canvas.bordered, .drawing, .fixed, .full, .interactive, .loading
input[list].no-arrow, .search
figure.bordered, .centered, .code, .float-start, .float-end, .full, .quote; figcaption: .centered, .end, .hidden
hgroup.byline, .centered, .display, .divided, .eyebrow, .section-header, .spaced, .tight
hr.decorative
iframe.bordered, .fixed, .full, .rounded
img.circle, .contain, .cover, .full, .ratio-landscape, .ratio-portrait, .ratio-square, .ratio-video, .rounded, .thumbnail; picture.full
main.contained, .flex, .full, .narrow, .padded, .wide, .with-sidebar
mark.error, .success, .warning
menu.compact, .context, .icons, .pills, .toolbar, .vertical
meter.xs, .s, .m, .l, .segmented
output.block, .inline, .large, .highlight, .success, .warning, .error, .hint, .error-summary
p.lead, .balance, .indent, .justify
progress.xs, .s, .m, .l, .success, .warning, .error
search.compact, .expanded, .header, .inline, .rounded, .with-icon
section.alt, .bordered, .contained, .full, .grid, .hero, .padded
svg.xs–.xxl, .currentcolor, .full, .interactive, .muted, .pulse, .spin
time.datetime, .relative
video.cover, .full, .rounded, .square, .standard, .ultrawide, .widescreen

Global helpers

Two classes work on any element:

ClassEffect
.visually-hiddenHidden on screen, still read by screen readers (Hiding text visually)
.skip-linkA link kept off screen until it takes keyboard focus (Skip link)
.flowVertical rhythm: space between direct children

In Vanilla Breeze

  • Element-scoped selectors. Variants are written as element.class (or nested &.class inside the element's rule) in src/native-elements/<element>/styles.css. A class on the wrong element does nothing.
  • Themes can restyle variants. Most variants set custom properties (for example --_active-bg on nav.pills) that themes override.
  • Build-system classes. nav a.active is styled like aria-current="page" for site generators that can only add a class. Prefer aria-current: it is also announced.
  • Your own classes are fine. VB does not reserve class names, so project classes sit alongside VB's.

Accessibility

  • A class is invisible to assistive technology. Never use a class alone to carry state ("current", "selected", "disabled"). Use the native or ARIA attribute, which VB styles anyway.
  • .visually-hidden is for text, not controls. A focusable element hidden this way vanishes when a keyboard user reaches it.

Gotchas

  • Same word, different element. .compact on <header> reduces header padding; on <article> it makes a compact list row (flex, small padding, a bottom border). There is no global .compact.
  • .lead is p.lead. It has no effect on other elements.
  • There is no .sticky and no table.compact. Use data-sticky and data-density="compact".

Related

Which to choose

  • Class — a named look for one element: button.secondary.
  • data-* — a value or a state: data-density="compact", data-sticky.
  • Native or ARIA attribute — state that users of assistive technology must hear: aria-current, disabled.
↑