Tailwind CSS & shadcn/ui
Pairing DESIGN.md with generated CSS tokens ensures agents pick the right semantic classes while the browser enforces exact values at render time. DesignMD Pro runs three pure client-side generators for stylesheet output.
Tailwind CSS v4 (@theme)
Open the Tailwind v4 Theme Generator and paste any DESIGN.md. The generator reads your frontmatter token maps and outputs CSS ready for globals.css:
DESIGN.md token group | Emitted CSS output |
|---|---|
colors.<key> | --color-<key>: <hex>; inside @theme |
colors.light.<key> | --color-<key>: <hex>; inside @theme (base theme) |
colors.dark.<key> | --color-<key>: <hex>; inside .dark |
typography families | --font-sans (first family), --font-sans-2, … |
typography scales | --text-<key> and --text-<key>--line-height |
rounded.<key> | --radius-<key>: <dim>; |
spacing.<key> | --spacing-<key>: <dim>; |
Example output:
@theme {
--color-primary: #4338ca;
--color-background: #ffffff;
--color-surface: #f6f5f4;
--color-text: #18181b;
--font-sans: "Inter", sans-serif;
--text-body-md: 16px;
--text-body-md--line-height: 1.6;
--radius-md: 8px;
--spacing-md: 16px;
}
.dark {
--color-primary: #818cf8;
--color-background: #0f172a;
}Plain CSS Variables
The CSS Variables Generator emits framework-agnostic :root and .dark custom properties:
colors.<key>→--<key>: <hex>;(withcolors.dark.*placed in.dark)typography.<key>→--font-<key>,--font-<key>-size,--font-<key>-weight,--font-<key>-line-heightrounded.<key>→--radius-<key>spacing.<key>→--spacing-<key>
shadcn/ui semantic mapping
The shadcn Theme Generator maps DESIGN.md color keys onto shadcn’s standard CSS variables using semantic key matching (evaluated in order; first match per variable wins):
| Token key pattern | shadcn CSS variable |
|---|---|
background, canvas, page, bg | --background |
surface, card, popover, elevated | --card |
primary, brand | --primary |
on-primary, onprimary, primary-foreground | --primary-foreground |
secondary | --secondary |
muted, subtle, disabled | --muted |
accent, tertiary | --accent |
destructive, error, danger | --destructive |
border, outline, divider, stroke | --border |
ring, focus | --ring |
text, foreground, fg, heading, body | --foreground |
| Any unmatched key | --color-<key> |
For border radius, the generator maps rounded.md (falling back to rounded.base or rounded.default) to --radius. Nested colors.dark.* keys run through the same semantic mapping inside .dark.
Naming your keys background, surface, primary, on-primary, text, muted, and border (as shown in the Complete Example) makes both the shadcn theme mapper and the WCAG contrast validator work without extra configuration.
Next steps
- Token Naming — naming patterns that optimize codegen and lint accuracy
- Design Tokens — details on nested
light/darktoken maps - Vercel v0 and Bolt — combine generated CSS with browser UI builder workflows