Vanilla Breeze

Packs

A pack is a self-contained extension that adds capabilities or a visual identity to Vanilla Breeze. Packs come in three types:

Functional

Add JS behaviors and components. No theme tokens — they work with any theme. Examples: ui, effects, prototype.

Aesthetic

Pure visual themes — token overrides for colors, fonts, radii, easing. No JS, no new components. CSS-only.

Full

Theme + effects + components in one coherent package. A complete visual identity. Examples: kawaii, memphis.

Mental Model

Vanilla Breeze core ships tokens, layouts, and web components. A pack extends this with:

Theme

Token overrides scoped to [data-theme~="name"]. Changes colors, fonts, radii, easing. Zero new CSS rules — just different values.

Effects

CSS and JS animations activated by data-effect. Add data-effect="neon" or data-effect="flipboard" to any element.

Components

Web components with pack-specific chrome. They consume core tokens automatically — switch theme and the component adapts.

All three layers are optional. A pack can ship just a theme, just effects, just components, or any combination.

Token Inheritance

This is the key insight: pack components consume the same tokens as core. When you switch from data-theme="kawaii" to data-theme="swiss", or change the color accent via ThemeManager.setAccent('ocean'), every pack component re-renders with the new colors, fonts, and spacing. No code changes needed.

Loading a Pack

CDN (static)

Load the full pack alongside core:

Granular Loading

Load only the parts you need:

Runtime Activation

Load a pack dynamically from JavaScript:

activateBundle injects a <link> for the CSS and import()s the JS. It returns a Promise that resolves when both are loaded.

Layer Architecture

Vanilla Breeze uses CSS @layer to manage cascade priority. Pack layers sit after core layers, ensuring pack styles always win over core defaults without specificity battles:

Layer Purpose Owner
tokensutils Core Vanilla Breeze styles Core
bundle-theme Token overrides for [data-theme~="name"] Pack theme file
bundle-effects CSS effects activated by data-effect Pack effects file
bundle-components Web component styles (inside Shadow DOM) Pack component files

When no pack is loaded, the three bundle layers are empty declarations — zero cost.

Pack Anatomy

A pack lives in src/packs/{name}/ and follows a strict file convention:

The build pipeline produces granular and combined outputs:

Theme File

The theme file overrides core tokens inside a @layer bundle-theme block, scoped by a [data-theme~="name"] selector:

Because it uses the ~= (word match) selector, users can combine themes: data-theme="kawaii dark".

Writing Effects

CSS Effects

CSS effects are data-effect attribute selectors in the bundle-effects layer. They must:

JS Effects

JS effects use the VB.effect() API. The effect system provides a shared MutationObserver that auto-initializes effects on dynamically added elements:

Callback Return Required Description
{ activate() } No Called when the effect’s trigger fires
{ cleanup() } No Called when the element is removed or the effect is replaced

Writing Components

Registration

Components use registerComponent for priority-based conflict resolution. Since customElements.define() is permanent, the registry uses first-wins semantics with priority tiebreaking:

Token Contract

Every pack component documents which tokens it consumes and which it exposes. This makes the dependency chain explicit and enables tooling:

Component Rules

  1. Shadow DOM required — isolates component styles from the page
  2. ::part() API — expose named parts for external styling
  3. Consume tokens, not hard values — use var(--color-primary) not oklch(70% 0.28 145)
  4. Progressive enhancement — slot a native <audio> for JS-off fallback
  5. Static metadata — declare bundle, contract, version, token arrays

Available Packs

Try the packs in the interactive explorer, or load them individually in your projects.

Functional Packs

Add capabilities beyond core. Work with any theme.

UI Pack

Theme picker and environment manager for broad theme switching UIs.

Effects Pack

Text effects, animated images, ticker counters, and star ratings.

Prototype Pack

Placeholder content for rapid prototyping and wireframing.

UX Planning Pack

User personas, stories, journey maps, empathy maps, impact/effort matrices, and story maps.

Design System Pack

Token specimens, component samplers, and CSS patterns for documenting brand guidelines.

Extras

Standalone modules loaded separately: data-emoji, <emoji-picker>, extended emoji set.

Font Packs

Opt-in variable font bundles. One file per typographic role — no multi-weight loading.

Foundation Fonts

Inter (sans/UI), Literata (serif/editorial), Recursive (mono/code). Variable fonts with axis-aware tokens.

Display Fonts

Fraunces (WONK/SOFT axes), Cormorant (Garamond-lineage), Bodoni Moda (dramatic contrast). For editorial and marketing.

Expressive Fonts

Nabla (COLR v1 3D depth), Honk (inflatable neon), Kablammo (comic impact). For hero sections and creative contexts.

Material Icons

Material Symbols Outlined variable icon font with attractor animations. Context-aware weight and optical size.

Full Packs

Theme + effects + components — a complete visual identity in one package.

Kawaii / Cute

Pastel pink/mint/lavender palette, pill shapes, bouncy motion, Cherry Bomb One display font, sparkle particles.

Memphis

Bold flat colour, geometric surface patterns (stripes, dots, zigzag, squiggle, confetti), hard drop shadows, Boogaloo + Outfit + Space Mono fonts.

Try Them

Pack Explorer

Interactive demo page — load and switch between all available packs live.

Next Steps

Pack Explorer

Try packs live in the interactive demo.

Principles

Understand the progressive enhancement philosophy.

Themes

Learn about the core token system that packs extend.