Skip to content
AZ Tools

Color Token Exporter

Define a color palette once, export to CSS custom properties, Tailwind config, SCSS, LESS, design-token JSON, SwiftUI Color, or Android colors.xml.

Preset:
Tokens
Preview
primary
primary-hover
surface
surface-muted
text
text-muted
border
danger
Output
:root {
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f5f5;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-danger: #ef4444;
}

Names get sanitized to kebab-case. Hex auto-expands #abc → #aabbcc.

How to use

  1. Pick a preset, or build your palette from scratch. Names get sanitized to kebab-case.
  2. Set a prefix that makes sense for your stack: color for CSS, colors (or leave blank) for Tailwind, none for SCSS if you want plain $primary.
  3. Switch format. Copy. Paste into your stylesheet, theme file, or assets catalog.

About this tool

Show

A single source of truth for a color palette, with one-click export to whichever stack you're shipping. Add tokens by name and hex (3, 6, or 8 digit), pick a prefix (color, brand, surface etc.), and the output regenerates in your chosen format. CSS gives --color-primary custom properties under :root. Tailwind gives a theme.extend.colors block you can paste into tailwind.config.js. SCSS gives both $color-primary vars and a $colors map for map.get. JSON follows the Design Tokens Community Group { value, type } shape. iOS gives a SwiftUI Color extension; Android gives the colors.xml resource format with underscores. Presets get you started with a brand, neutral scale, or status colors.

Frequently asked questions

Why a prefix?

Prefixing prevents collisions and makes intent clear. --color-primary reads better than --primary when you also have spacing tokens, radius tokens, etc. For Tailwind, the tokens always go under extend.colors (the only key Tailwind builds colour utilities from), and the prefix becomes a nested group there: prefix brand gives bg-brand-primary. Leave the prefix empty for plain bg-primary.

Does the Design Tokens JSON match the W3C spec?

Close. It uses { value, type: 'color' } per token, which matches the Design Tokens Community Group draft. For strict W3C compliance you may need to nest tokens under a group object — but most tools (Style Dictionary, Specify, Cobalt) handle the flat shape fine and run their own transformations.

How do I keep exports in sync once designers and code both change colours?

Make one place authoritative and generate the rest from it. The moment a colour is edited in two formats by hand, they drift, and the drift is invisible until someone screenshots two surfaces side by side. Keep the source palette in version control, regenerate the platform files as a build step, and treat a hand-edited export as a bug rather than a shortcut.

What should the tokens be named?

After their role, not their appearance, wherever a theme might change: a token called blue-500 becomes a lie the moment dark mode makes it lighter, while surface or accent survives. Literal colour names are fine as the underlying palette, with the role tokens pointing at them — that indirection is what lets a theme swap without renaming anything.

Related tools