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

Documenting a Design System

Turn a theme into a design system: pages of live specimens that show its colors, type, spacing and components, built with the vb-design-system package.

A theme with documentation

In Vanilla Breeze the look of a site is a theme: a set of token values. A design system is that theme plus the pages that explain it, so that the people who use it know which colors, sizes and components exist and when to choose each.

Those pages are usually drawn by hand and go out of date when a value changes. @profpowell/vb-design-system is a separate npm package of specimen elements that read the token values from the page they are on. Change --radius-m in the theme and the radius specimen shows the new corner. Switch the theme and every specimen follows.

What the package provides

Each name links to its page on the package's documentation site.

Purpose Elements
Show the tokens <token-specimen> (colors, sizes, radii, borders, shadows, icons), <type-specimen>, <spacing-specimen>, <motion-specimen>, <breakpoint-specimen>
Show what is built from them <component-sampler>, <layout-specimen>, <accessibility-specimen>
Choose colors and fonts <color-palette>, <semantic-palette>, <palette-generator>, <gradient-builder>, <font-pairer>
Show icons and the brand mark <icon-set>, <icon-specimen>, <brand-specimen>
Move a theme in and out <theme-catalog>, <theme-import>, <theme-export>

The package's stylesheet also has two patterns that need no script: a list of things to do and not to do (<ul data-list="do-dont"> with data-do and data-dont on the items) and a token reference table (the ds-token-table class on a <table>).

Install and load

Load Vanilla Breeze first, then the package's stylesheet and script.

Vanilla Breeze is an optional peer dependency. Without it the specimens render with fallback values of their own, which defeats their purpose. Three elements also use a Vanilla Breeze component when it is on the page: <palette-generator> uses <color-picker>, <token-specimen type="icon"> uses <icon-wc>, and <brand-specimen> uses <brand-mark>. The full Vanilla Breeze bundle has all three.

A design system page

Write the page as ordinary sections. The specimens need no values: each reads the tokens of the theme in force where it sits.

The prose between the specimens is the part only you can write: what each color is for, which size to use where, how the brand speaks.

Building the theme on the page

The token, type and spacing specimens take an editable attribute. Their values become inputs, and a change is written as a custom property on :root, or on the element named by target. <theme-export live> collects those changes and shows them as a block of CSS to copy into a theme file.

The Theme Composer on the package's site is this arrangement with every specimen, the catalog and the import element on one page. The export can also be a token file for other design tools: see Design Token Exchange.

Where to go next

Element reference

Attributes and events for every specimen and tool.

Meridian showcase

A complete design system for an invented company, built with the package.

Building design systems

The package's own guide, from a first theme to a documented system.

Writing a theme

The token values a theme sets, and where the file goes.

↑