Developer Tool
Design Token Generator
Create, organize, and export comprehensive color design tokens for your design system.
Token Configuration
/* Color Tokens */
:root {
--color-primary: #6366f1;
--color-secondary: #ec4899;
--color-accent: #f59e0b;
}
/* Semantic Tokens */
:root {
--semantic-success: #22c55e;
--semantic-warning: #eab308;
--semantic-error: #ef4444;
--semantic-info: #3b82f6;
}
/* Surface Tokens */
:root {
--surface-background: #ffffff;
--surface-surface: #f9fafb;
--surface-elevated: #ffffff;
--surface-overlay: rgba(0,0,0,0.5);
}
/* Text Tokens */
:root {
--text-primary: #111827;
--text-secondary: #6b7280;
--text-muted: #9ca3af;
--text-inverse: #ffffff;
}
/* Border Tokens */
:root {
--border-default: #e5e7eb;
--border-strong: #d1d5db;
--border-focus: #6366f1;
}
/* State Tokens */
:root {
--state-hover: #f3f4f6;
--state-active: #e5e7eb;
--state-disabled: #f9fafb;
--state-focus-ring: #6366f1;
}
About the Design Token Generator
Design tokens are the atomic building blocks of a design system. This tool helps you organize your color palette into logical, semantic groups and export them into the formats you need for your web projects, bridging the gap between design and development.
What Are Design Tokens?
Instead of hardcoding colors like #6366f1 across your application, design tokens allow you to give them meaningful names like --color-primary. This makes maintaining, scaling, and theming (like adding dark mode) significantly easier.
Token Groups
Color Tokens
The core brand colors (primary, secondary, accent) that define your identity.
Semantic Tokens
Colors mapped to meaning (success, warning, error, info) to convey state and feedback.
Surface Tokens
Background colors for different levels of elevation and structural elements.
Text & Border Tokens
Specific colors for typography and structural boundaries to ensure proper contrast.
Export Formats
- CSS: Generates standard CSS variables (
--var-name) organized by group. Perfect for traditional stylesheets and CSS modules. - JSON: Creates a structured, nested JSON object. Ideal for cross-platform processing and tooling integrations.
- TypeScript: Outputs a typed
constobject. Great for CSS-in-JS libraries (like Styled Components or Emotion) and type-safe configurations.