The Util Box

Design Token Generator

Free online design token generator. Generate design system tokens. Perfect for designers and developers.

Base Colors

--color-primary

#3b82f6

--color-primary-hover

#326fd1

--color-primary-active

#295bac

--color-primary-disabled

rgba(59, 130, 246, 0.5)

--color-secondary

#64748b

--color-secondary-hover

#556376

--color-secondary-active

#465161

Generated CSS
/* Design Tokens - Light Theme */
:root {
  --color-primary: #3b82f6;
  --color-primary-hover: #326fd1;
  --color-primary-active: #295bac;
  --color-primary-disabled: rgba(59, 130, 246, 0.5);
  --color-secondary: #64748b;
  --color-secondary-hover: #556376;
  --color-secondary-active: #465161;
  --color-accent: #8b5cf6;
  --color-accent-hover: #764ed1;
  --color-accent-active: #6140ac;
  --color-accent-disabled: rgba(139, 92, 246, 0.5);
  --color-neutral: #6b7280;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #06b6d4;
  --surface-background: #ffffff;
  --surface-surface: #f8fafc;
  --surface-card: #ffffff;
  --surface-elevated: #ffffff;
  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --border-default: #e2e8f0;
  --border-focus: #3b82f6;
  --border-divider: #f1f5f9;
}

Embed this tool

Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.

<iframe src="https://www.theutilbox.org/embed/design-token-generator" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free Design Token Generator tool from The Util Box"></iframe>
<!-- Free tool by The Util Box — https://www.theutilbox.org/tools/design-token-generator -->
<a href="https://www.theutilbox.org/tools/design-token-generator">Design Token Generator by The Util Box</a>

Frequently Asked Questions about Design Token Generator

Design Token Generator — A Full CSS Variable Set from Seven Colours

This design token generator takes seven base colours and produces a complete set of CSS custom properties — twenty-eight of them — covering your brand colours, their hover and active states, the disabled state, the surface and text colours for light or dark mode, and your borders.

The output is a ready-to-paste :root block, and a row of swatches previews the primary tokens as you change them.

The Token Set

Group Tokens
Primary Base, hover, active and disabled
Secondary Base, hover and active — the base is a fixed slate grey, not editable
Accent Base, hover, active and disabled
Status Neutral, success, warning, error and info — base values only
Surfaces Background, surface, card and elevated
Text Heading, body, muted and inverse
Borders Default, focus and divider

How the Variants Are Derived

The hover and active states are generated by shifting each colour channel towards white or black, and the direction depends on the theme:

  • In the light theme, hover darkens the colour by 15% and active darkens it by 30%.
  • In the dark theme, hover lightens by 20% and active lightens by 35%.
  • The disabled state is the base colour at 50% alpha, written as an rgba() value.

Switching to the dark theme also swaps the surface, text and border tokens for their dark-mode equivalents, so you get a complete second palette rather than a recoloured brand colour.

Limits Worth Knowing

  • Both themes emit :root. To support a light and a dark theme on the same page you have to change the selector yourself — to [data-theme="dark"], or wrap it in a prefers-color-scheme media query.
  • The darkening and lightening are done per channel, which changes saturation as well as brightness. A saturated blue darkened this way goes noticeably muddy, so check the derived hover state rather than assuming it is right.
  • The secondary colour is hardcoded to slate grey and cannot be changed, and the four status colours have no hover or active variants at all.
  • Only colour tokens are generated. There are no spacing, typography, radius, shadow or motion tokens.

Related Colour and Design Tools

The token set is generated locally in your browser; no colour is uploaded.