Exporting design systems to Tailwind, shadcn and CSS variables
The same generated system as Tailwind v4 @theme, a shadcn/ui oklch stylesheet, DTCG JSON and plain CSS variables — and when to reach for each export.
One system, four dialects
The full design system generator ships its generated system through several export adapters, and they are not interchangeable ways of saying the same thing — each targets a consumer. CSS variables are the runtime contract for a hand-rolled stylesheet; Tailwind v4 maps tokens into the @theme namespace; shadcn/ui writes a drop-in oklch stylesheet for that component library; W3C tokens hand the whole system to a token pipeline.
The key guarantee is that every dialect is generated from the same in-memory system — the export never re-derives colors, so hex, oklch and token files can't drift out of sync.
Tailwind v4: @theme and a dark variant
The Tailwind export produces a complete theme file: it registers a .dark custom variant, then maps every semantic token into :root and .dark blocks, then wires them into @theme inline so utilities like bg-background and text-primary resolve to the tokens. The brand 50–950 scale lands as --color-brand-* inside the same @theme block, plus the type scale, radius and shadows as their own namespaces.
Spacing is deliberately left at Tailwind defaults so the file composes with the framework instead of fighting it. The single standalone Tailwind color generator produces the plain @theme scale block if all you need is the 11-step brand scale without the system.
@import "tailwindcss";
@custom-variant dark (&:is(.dark *));
:root {
--background: #fdfcff;
--foreground: #13101e;
--primary: #6d28d9;
}
.dark {
--background: #0b0a0f;
--foreground: #edebf6;
--primary: #8c56ff;
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-primary: var(--primary);
--color-brand-500: #9f7fff;
}shadcn/ui: the oklch stylesheet
The shadcn export writes the theme in the exact dialect that library expects: :root and .dark blocks, variable names covering card, popover, secondary, muted, accent, destructive, border, input, ring and the sidebar tokens, all as oklch() values. It fills chart-1 through chart-5 from the palette, and sets the canonical --radius: 0.625rem so component radii stay in family.
Because shadcn themes are oklch-native, this export is where the 'same system, different formats' payoff is most visible: the identical color is spelled oklch(0.62 0.22 292) here and #6d28d9 in the CSS export — two correct spellings of one decision.
:root {
--background: oklch(0.993 0.004 301.4);
--foreground: oklch(0.184 0.028 293.2);
--primary: oklch(0.491 0.241 292.6);
--primary-foreground: oklch(1 0 0);
--radius: 0.625rem;
}
.dark {
--background: oklch(0.149 0.011 294.2);
--foreground: oklch(0.945 0.015 294.5);
--primary: oklch(0.605 0.237 292.6);
}CSS variables and W3C tokens, when to reach for them
Plain CSS variables are the most boring, most interoperable export: a :root/.dark pair of semantic tokens matching your component layer's expected names. Reach for them when you own the styling and want zero framework assumptions. DTCG/W3C JSON is the opposite pole — it carries no CSS at all, just $type/$value/$description data for token tooling, and a bundle export wraps the W3C file with a README for handoff.
A tidy workflow many teams land on: W3C tokens in the pipeline as source of truth, CSS variables in the running site, and Tailwind/shadcn exports wherever a framework needs the same decisions in its own dialect.
Related free tools
Want to apply this right now? Open the color palette generator and try it with your own brand color — free, no sign-up.