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

div

Generic block-level container. In Vanilla Breeze, div usage is discouraged — prefer semantic elements and VB layout primitives.

Philosophy

Vanilla Breeze takes an intentional stance: <div> is a last resort, not a default. The VB conformance checker flags every <div>: as an error in newly added files and as a warning in existing ones. The separate semantic check reports classed divs as informational suggestions.

This is not about being pedantic — semantic elements provide:

  • Accessibility: Screen readers can navigate by landmarks (<nav>, <main>, <aside>)
  • SEO: Search engines understand content structure from semantic markup
  • Readability: Code is self-documenting when elements describe their purpose
  • Less CSS: VB styles semantic elements directly — no class soup

Semantic Alternatives

For every common <div> pattern, a semantic element exists:

Instead ofUse
<div class="card"><article>
<div class="sidebar"><aside>
<div class="nav"><nav>
<div class="header"><header>
<div class="footer"><footer>
<div class="main"><main>
<div class="section"><section>
<div class="actions"><footer> or <menu>
<div class="group"><fieldset>
<div data-layout="stack">Put data-layout on the semantic parent

Layout Without Divs

VB's layout attributes (data-layout) and custom elements (<layout-stack>, <layout-grid>, etc.) can be applied directly to semantic elements:

When no semantic element fits, VB layout custom elements (<layout-stack>, <layout-grid>, <layout-cluster>) serve as the container — they are more descriptive than <div> because they declare layout intent.

Legitimate Uses

There are a few cases where <div> is the correct choice:

  • <dl> grouping: HTML5 allows <div> inside <dl> to group <dt>/<dd> pairs (for striped styling)
  • Third-party widgets: When external libraries require a container div
  • CSS Grid/Flex children: When you genuinely need a non-semantic grid cell

The conformance checker exempts <div> elements that are direct children of <dl> automatically — no allowlist entry is needed for them.

Conformance Enforcement

VB enforces semantic HTML through automated tooling:

  • vb/no-div — Flags any <div> element except <dl> > <div> groupings. Suggests semantic alternatives. It is an error in files that are new to the repository and a warning in existing files.
  • vb/no-div-wrapper — Flags <div> wrapping a single semantic child (the div is unnecessary).
  • Allowlist: Known legitimate uses can be added to scripts/vb-conformance-allowlist.json (rule name → list of file paths). Allowlisted files are downgraded to warnings rather than skipped.

Run npm run conformance to check your HTML files.

The VB Refinement Checklist

When auditing existing code with divs, follow this order:

  1. Div audit: Can each div be replaced with a semantic element?
  2. Wrapper audit: Is a div wrapping a single child that could receive the attributes directly?
  3. data-layout audit: Is data-layout on a div when it could be on the semantic parent?
  4. Class audit: Are VB element-scoped classes available (e.g., form.stacked)?
  5. Semantic opportunities: Can <footer> replace a button group div? Can <header> replace a title wrapper?

Accessibility

  • <div> maps to the generic ARIA role: its content is read normally, but the element itself conveys no meaning and is not a landmark
  • Screen readers cannot navigate by divs; they can navigate by landmarks, headings, lists, and other semantic elements
  • Every div you replace with a semantic element improves the accessibility tree

Related

  • <span> — Generic inline container (same philosophy: last resort)
  • <section> — Thematic grouping of content
  • <article> — Self-contained content
  • <aside> — Tangentially related content
  • <nav> — Navigation sections
  • <header> — Introductory content
  • <footer> — Footer content and action groups
  • <main> — Dominant content of the page
  • <menu> — Action button groups
  • <fieldset> — Form field grouping
↑