Docs / Format spec
Tokens
Design tokens are the named, reusable values in the YAML front matter: colors, type scales, spacing, and border-radius. They form the single source of truth that both the CLI and AI agents read.
Once defined in the front matter, tokens can be referenced anywhere inside components using {namespace.key} syntax — keeping your component definitions DRY and automatically consistent with the token layer.
Color tokens
The colors object accepts any valid CSS color string. Prefer semantic names (what the color means) over descriptive names (what the color looks like).
colors:
# Primary brand colors
primary: "#0A0A0A"
accent: "#E63946"
# Neutral scale
neutral-50: "#FAFAFA"
neutral-100: "#F5F5F5"
neutral-900: "#171717"
# Semantic
surface: "#FFFFFF"
error: "#D32F2F"
success: "#388E3C"textColor and backgroundColor defined, it automatically checks that the contrast ratio meets WCAG AA (4.5:1 for normal text, 3:1 for large text).Typography tokens
The typography object is keyed by role. Common role names are h1–h6, body, body-sm, label, caption, and mono, but any key is valid.
fontFamilyfontSizefontWeightlineHeightletterSpacingtypography:
h1:
fontFamily: "Plus Jakarta Sans"
fontSize: 3.5rem
fontWeight: 800
lineHeight: 1.05
letterSpacing: -0.035em
h2:
fontFamily: "Plus Jakarta Sans"
fontSize: 2rem
fontWeight: 700
lineHeight: 1.15
body:
fontFamily: "Inter"
fontSize: 1rem
fontWeight: 400
lineHeight: 1.65
label:
fontFamily: "Manrope"
fontSize: 0.75rem
fontWeight: 500
letterSpacing: 0.06emSpacing tokens
Named spacing values that define your layout grid. Use any CSS length unit. A consistent scale prevents arbitrary values appearing in AI-generated code.
spacing:
1: 4px
2: 8px
3: 12px
4: 16px
6: 24px
8: 32px
12: 48px
16: 64pxOr use named sizes if that fits your team's language better:
spacing:
xs: 4px
sm: 8px
md: 16px
lg: 32px
xl: 64px
2xl: 128pxRounded tokens
Named border-radius values. The linter accepts any valid CSS border-radius, including the canonical pill value.
rounded:
none: 0
sm: 4px
md: 8px
lg: 16px
xl: 24px
2xl: 32px
full: 9999pxToken references
Inside the components block, any value can reference a previously defined token using {namespace.key}. References are resolved by the CLI and can also be expanded by AI agents before generating code.
# Token definitions
colors:
brand: "#0070F3"
spacing:
md: 16px
rounded:
pill: 9999px
# References in components
components:
cta-button:
backgroundColor: "{colors.brand}" # resolves to #0070F3
padding: "{spacing.md} 24px" # resolves to 16px 24px
rounded: "{rounded.pill}" # resolves to 9999px