Docs / Format spec
Frontmatter
The YAML front matter block sits between the opening and closing --- delimiters. It holds all machine-readable design tokens: colors, typography, spacing, border-radius, and component styles.
The block is optional — a DESIGN.md file that contains only a markdown body is valid. But the front matter is what AI tools and the CLI use for precise, repeatable output. Without it, agents fall back to guessing from prose alone.
Top-level fields
nameversioncolorstypographyspacingroundedcomponentsColors
Color values can be any valid CSS color string: hex, rgb(), hsl(), or oklch(). Token names should be semantic, not descriptive — prefer primary over dark-blue.
colors:
primary: "#1A1C1E"
accent: "#B8422E"
neutral: "#F7F5F2"
surface: "#FFFFFF"
error: "#D32F2F"
success: "#388E3C"Typography
Typography tokens are keyed by role. Each role can define any combination of the supported properties below.
fontFamilyfontSizefontWeightlineHeightletterSpacingtypography:
h1:
fontFamily: "Plus Jakarta Sans"
fontSize: 3rem
fontWeight: 700
lineHeight: 1.1
letterSpacing: -0.02em
body:
fontFamily: "Inter"
fontSize: 1rem
fontWeight: 400
lineHeight: 1.6
label:
fontFamily: "Manrope"
fontSize: 0.75rem
fontWeight: 500
letterSpacing: 0.06emSpacing
A named scale of spacing values. Use any CSS length unit. These tokens can be referenced in component definitions with {spacing.md}.
spacing:
xs: 4px
sm: 8px
md: 16px
lg: 32px
xl: 64pxRounded
Named border-radius tokens. The special value 9999px is the canonical way to express a pill / fully-rounded shape.
rounded:
sm: 4px
md: 8px
lg: 16px
xl: 24px
full: 9999pxComponents
Component tokens define the visual style of named UI components. Each key is a component identifier (use kebab-case). Values are any combination of the allowed properties below.
backgroundColortextColorborderColorborderWidthroundedpaddingfontSizefontWeightcomponents:
button-primary:
backgroundColor: "{colors.primary}"
textColor: "#FFFFFF"
rounded: "{rounded.full}"
padding: "12px 24px"
fontWeight: 600
button-ghost:
backgroundColor: "transparent"
textColor: "{colors.primary}"
borderColor: "{colors.primary}"
borderWidth: "1px"
rounded: "{rounded.full}"
padding: "12px 24px"
card:
backgroundColor: "{colors.surface}"
rounded: "{rounded.lg}"
padding: "{spacing.lg}"
borderColor: "#E5E5E5"
borderWidth: "1px"Token references
Component properties can reference other tokens using curly-brace syntax: {namespace.key}. The linter will report an error if a reference points to a token that does not exist.
{colors.primary}{spacing.md}{rounded.full}{colors.brand} where brand is not defined under colors will fail the linter with a broken reference error.