Ship a full design system with a CSS variable theme generator
The CSS variable theme generator turns scattered hex codes into a coherent, exportable token set. Define your palette, spacing scale, radii, shadows, and typography once, preview them on real UI components, and copy the result as CSS custom properties, a Tailwind v4 @theme block, or an SCSS map — no rebuilds, no JavaScript config gymnastics.
Modern token workflows treat raw values as just one layer. Best-practice token architecture stacks base values, semantic aliases, and component overrides so a single edit to --color-surface cascades across every screen. This tool follows that pattern out of the box.
What you get from the generator
- Live UI preview — buttons, cards, inputs, alerts, and typography re-render as you tweak tokens.
- Three export formats — CSS custom properties for any stack, Tailwind v4
@themefor utility generation, or SCSS variables and maps for legacy Sass pipelines. - Light and dark modes — paired values plus a
prefers-color-schemeblock and a manual[data-theme]selector. - Perceptual color math — scales are generated in OKLCH so 50→950 steps stay visually even across hues.
Tailwind v4: tokens become utilities
Tailwind v4 reads CSS variables natively. Paste the generator's output inside @import "tailwindcss"; @theme { … } and every token automatically produces matching utilities like bg-primary-500 or rounded-lg. See the official Tailwind theme variables docs for the full namespace map. If you need a base palette to start from, browse the Tailwind CSS Colors reference and drop your favourites into the generator.
Plain CSS and SCSS exports
For framework-free projects, copy the :root { --color-… } block straight into your global stylesheet. The MDN guide to custom properties covers cascading, scoping, and fallback patterns. For Sass codebases, the SCSS export emits both individual variables and a single $tokens map for iteration.
How the tokens come together
- Choose a brand color. The generator builds an 11-step tint and shade scale — pair it with the tint & shade scale generator if you want to fine-tune individual stops.
- Lock semantic aliases (
--color-surface,--color-text,--color-border) on top of the raw scale. - Verify contrast pairings with the palette contrast grid so every combination passes WCAG.
- Export, paste, ship. If you need to share the system, hand off a design token JSON file for Figma and other downstream tools.
The result is one source of truth that powers your CSS, your Tailwind utilities, and your Sass — without copying hex codes between files.