Overview
Learn how zudo-wind turns complete class candidates and project tokens into versioned CSS.
Configure and use a component
Wind uses familiar utility spellings with values chosen by your project. Put this complete wind object at the root of zfb.config.json (or the equivalent wind property in zfb.config.ts):
{
"wind": {
"spec": 1,
"reset": "none",
"strict": true,
"tokens": {
"spacing": { "hsp-sm": "0.75rem", "vsp-md": "1.25rem" },
"colors": { "surface": "#f4f1ec", "ink": "#203046" },
"radii": { "card": "0.5rem" }
}
}
}Use complete classes: px-hsp-sm applies the horizontal spacing token, py-vsp-md applies vertical spacing, bg-surface and text-ink use the named colors, and rounded-card uses the radius. The literal color values need no authored custom-property declarations. block, inline-flex, and hidden need no tokens; hidden is the display-none utility, not none. mx-auto also needs no token and uses physical left/right margins. The preview below uses this configuration and shows its separate authored presentation CSS.
<div class="wind-demo-grid flex"><article class="wind-demo-card block rounded-card bg-surface px-hsp-sm py-vsp-md"><h3 class="wind-demo-title text-ink">A configured card</h3><p>Every value is project defined.</p></article><article class="wind-demo-card inline-flex rounded-card bg-surface px-hsp-sm py-vsp-md"><span class="text-ink">Complete classes</span></article></div>@layer zw-reset, zw-tokens, zfb-hi, base, components;
@layer zw-tokens {
:root {
--zw-color-ink: #203046;
--zw-color-surface: #f4f1ec;
--zw-radius-card: .5rem;
--zw-spacing-hsp-sm: .75rem;
--zw-spacing-vsp-md: 1.25rem;
}
}
.wind-demo-grid {
font: 14px / 1.5 system-ui, sans-serif;
color: #203046;
}
.wind-demo-card {
border: 1px solid #8797aa;
}
.wind-demo-title {
margin: 0 0 .5rem;
font-size: 1rem;
font-weight: 600;
}
.block {
display: block;
}
.flex {
display: flex;
}
.inline-flex {
display: inline-flex;
}
.px-hsp-sm {
padding-left: var(--zw-spacing-hsp-sm);
padding-right: var(--zw-spacing-hsp-sm);
}
.py-vsp-md {
padding-top: var(--zw-spacing-vsp-md);
padding-bottom: var(--zw-spacing-vsp-md);
}
.text-ink {
color: var(--zw-color-ink);
}
.bg-surface {
background-color: var(--zw-color-surface);
}
.rounded-card {
border-top-left-radius: var(--zw-radius-card);
border-top-right-radius: var(--zw-radius-card);
border-bottom-right-radius: var(--zw-radius-card);
border-bottom-left-radius: var(--zw-radius-card);
}Configuration for this example
{
"wind": {
"spec": 1,
"reset": "none",
"strict": true,
"tokens": {
"spacing": {
"hsp-sm": "0.75rem",
"vsp-md": "1.25rem"
},
"colors": {
"surface": "#f4f1ec",
"ink": "#203046"
},
"radii": {
"card": "0.5rem"
}
},
"breakpoints": {},
"defaultTransitionTimingFunction": "ease",
"authoredClasses": {
"wind-demo-grid": true,
"wind-demo-card": true,
"wind-demo-title": true
},
"safelist": {
"docs-preview": [
"flex",
"block",
"inline-flex",
"rounded-card",
"bg-surface",
"px-hsp-sm",
"py-vsp-md",
"text-ink"
]
}
}
}Authored demonstration CSS
.wind-demo-grid { font: 14px/1.5 system-ui, sans-serif; color: #203046; }
.wind-demo-card { border: 1px solid #8797aa; }
.wind-demo-title { margin: 0 0 .5rem; font-size: 1rem; font-weight: 600; }From here, open configuration and sources and candidates, or browse the token guide and complete utility index.
Language and build details
What zudo-wind does
zudo-wind is the utility CSS language owned by zfb. It recognizes a closed set of complete class candidates, resolves them against the tokens and breakpoints you configure, and asks the zfb compiler to emit CSS. Its contract is versioned, so the supported language does not expand implicitly when another tool changes.
A candidate either resolves to a utility, is recognized but invalid and receives a diagnostic, or remains an ordinary class with no generated rule. A class name that is not constructed as a complete candidate cannot be guessed at build time. zudo-wind does not load utility plugins or execute project JavaScript to discover classes.
Where it fits
The build gathers candidates from the configured source plan, combines generated wind rules with authored global CSS, and processes CSS Modules on their separate path. Authored CSS remains the place for selectors and declarations outside the utility language. Wind rules are emitted without a CSS layer after authored global rules; see Cascade and reset for the full ordering.
Source discovery reads eligible file contents as text. It does not run the application. For the files scanned in build and dev, see Sources and candidates. For global CSS and CSS Modules, see the styling guide.
A first example
This configuration supplies every non-static value used below. The default reset is none, and no palette or spacing scale is added for you.
{
"wind": {
"tokens": {
"spacingUnit": "0.25rem",
"colors": {
"panel": "var(--app-panel)"
},
"radii": {
"default": "0.5rem"
}
}
}
}Place the same top-level wind value in zfb.config.ts or zfb.config.json. An authored stylesheet can define the project property that the color token references:
:root {
--app-panel: #f4f1ec;
}A component can then use these complete candidates:
<section class="rounded bg-panel p-4 text-panel">
Welcome
</section>rounded uses radii.default, bg-panel and text-panel use colors.panel, and p-4 multiplies four by the configured spacing unit. If a required token or unit is absent, the recognized utility produces a missing-token diagnostic instead of receiving an invented value. The token guide explains these bindings.
Versioned behavior
The v1 language has spec: 1; omitting that field means version 1. The compiler identifies generated rules as zudo-. V1 does not generate a source map or promise line mappings for its generated CSS.
The utility syntax may look familiar if you have used Tailwind, but zudo-wind does not promise compatibility; see Coming from Tailwind.