Ship a palette as real code with the HEX to design token exporter
The HEX to design token exporter turns a flat list of color values into the four artifacts every modern front-end actually consumes: CSS custom properties on :root, SCSS variables for Sass codebases, a Tailwind theme.extend.colors object, and a JSON file shaped for design-token pipelines. Paste your HEX values, name each swatch, and copy the output — no Style Dictionary config, no Node script, no manual reformatting.
Tokens are the connective tissue between design and engineering. Design tokens act as a single source of truth for design decisions, defined in a JSON file and processed by a transformer that outputs them in multiple formats — for the web, tokens become Tailwind config values or CSS variables. This tool gives you those same outputs without standing up a build pipeline first.
What you can export
- CSS custom properties — declared on
:rootso any selector can reference them withvar(--color-primary). Drop straight into a global stylesheet or Tailwind v4's@themeblock. - SCSS variables —
$color-primary: #2563eb;declarations ready to@usein a partial. - Tailwind config — a
theme.extend.colorsobject you paste intotailwind.config.jsto unlockbg-primary,text-surface, and other utility classes. - JSON design tokens — nested objects with
valuefields, compatible with Style Dictionary and aligned with the W3C Design Tokens Community Group draft.
A workflow that scales
Once your palette lives as tokens, you can build the rest of your system on top of them. Generate a full numeric scale with the tint & shade scale generator, validate every swatch pair with the palette contrast grid, and wire up semantic light/dark variables in the CSS theme builder. The exporter is the final step that hands the result to your codebase.
Naming tips
- Prefer semantic names (
primary,surface,danger) over literal ones (blue) so a rebrand doesn't rename every variable. - Use numeric suffixes
50–950for tonal scales, matching the convention used across Tailwind CSS and Material Design. - Keep raw tokens platform-agnostic and layer aliases on top for component-specific colors.
Why design tokens?
Hard-coded HEX values scatter the same decision across dozens of files. Tokens centralize each color behind a name so one edit propagates everywhere — to CSS custom properties, Sass maps, Tailwind utilities, and any downstream platform that consumes the JSON. The result is a palette that's easy to theme, easy to audit, and easy to hand off.