UI Design System
Generate design tokens, create color palettes, calculate typography scales, build component systems, and prepare developer handoff documentation.
Table of Contents
Trigger Terms
Use this skill when you need to:
- "generate design tokens"
- "create color palette"
- "build typography scale"
- "calculate spacing system"
- "create design system"
- "generate CSS variables"
- "export SCSS tokens"
- "set up component architecture"
- "document component library"
- "calculate responsive breakpoints"
- "prepare developer handoff"
- "convert brand color to palette"
- "check WCAG contrast"
- "build 8pt grid system"
Workflows
Workflow 1: Generate Design Tokens
Situation: You have a brand color and need a complete design token system.
Steps:
Identify brand color and style
- Brand primary color (hex format)
- Style preference:
modern | classic | playful
Generate tokens using script
python scripts/design_token_generator.py "#0066CC" modern json
Review generated categories
- Colors: primary, secondary, neutral, semantic, surface
- Typography: fontFamily, fontSize, fontWeight, lineHeight
- Spacing: 8pt grid-based scale (0-64)
- Borders: radius, width
- Shadows: none through 2xl
- Animation: duration, easing
- Breakpoints: xs through 2xl
Export in target format
# CSS custom properties
python scripts/design_token_generator.py "#0066CC" modern css > design-tokens.css
# SCSS variables
python scripts/design_token_generator.py "#0066CC" modern scss > _design-tokens.scss
# JSON for Figma/tooling
python scripts/design_token_generator.py "#0066CC" modern json > design-tokens.json
Validate accessibility
- Check color contrast meets WCAG AA (4.5:1 normal, 3:1 large text)
- Verify semantic colors have contrast colors defined
Workflow 2: Create Component System
Situation: You need to structure a component library using design tokens.
Steps:
Define component hierarchy
- Atoms: Button, Input, Icon, Label, Badge
- Molecules: FormField, SearchBar, Card, ListItem
- Organisms: Header, Footer, DataTable, Modal
- Templates: DashboardLayout, AuthLayout
Map tokens to components
| Component |
Tokens Used |
| Button |
colors, sizing, borders, shadows, typography |
| Input |
colors, sizing, borders, spacing |
| Card |
colors, borders, shadows, spacing |
| Modal |
colors, shadows, spacing, z-index, animation |
Define variant patterns
Size variants:
sm: height 32px, paddingX 12px, fontSize 14px
md: height 40px, paddingX 16px, fontSize 16px
lg: height 48px, paddingX 20px, fontSize 18px
Color variants:
primary: background primary-500, text white
secondary: background neutral-100, text neutral-900
ghost: background transparent, text neutral-700
Document component API
- Props interface with types
- Variant options
- State handling (hover, active, focus, disabled)
- Accessibility requirements
Reference: See references/component-architecture.md
Workflow 3: Responsive Design
Situation: You need breakpoints, fluid typography, or responsive spacing.
Steps:
Define breakpoints
| Name |
Width |
Target |
| xs |
0 |
Small phones |
| sm |
480px |
Large phones |
| md |
640px |
Tablets |
| lg |
768px |
Small laptops |
| xl |
1024px |
Desktops |
| 2xl |
1280px |
Large screens |
Calculate fluid typography
Formula: clamp(min, preferred, max)
/* 16px to 24px between 320px and 1200px viewport */
font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);
Pre-calculated scales:
--fluid-h1: clamp(2rem, 1rem + 3.6vw, 4rem);
--fluid-h2: clamp(1.75rem, 1rem + 2.3vw, 3rem);
--fluid-h3: clamp(1.5rem, 1rem + 1.4vw, 2.25rem);
--fluid-body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);
Set up responsive spacing
| Token |
Mobile |
Tablet |
Desktop |
| --space-md |
12px |
16px |
16px |
| --space-lg |
16px |
24px |
32px |
| --space-xl |
24px |
32px |
48px |
| --space-section |
48px |
80px |
120px |
Reference: See references/responsive-calculations.md
Workflow 4: Developer Handoff
Situation: You need to hand off design tokens to development team.
Steps:
Export tokens in required formats
# For CSS projects
python scripts/design_token_generator.py "#0066CC" modern css
# For SCSS projects
python scripts/design_token_generator.py "#0066CC" modern scss
# For JavaScript/TypeScript
python scripts/design_token_generator.py "#0066CC" modern json
Prepare framework integration
React + CSS Variables:
import './design-tokens.css';
<button className="btn btn-primary">Click</button>
Tailwind Config:
const tokens = require('./design-tokens.json');
module.exports = {
theme: {
colors: tokens.colors,
fontFamily: tokens.typography.fontFamily
}
};
styled-components:
import tokens from './design-tokens.json';
const Button = styled.button`
background: ${tokens.colors.primary['500']};
padding: ${tokens.spacing['2']} ${tokens.spacing['4']};
`;
Sync with Figma
- Install Tokens Studio plugin
- Import design-tokens.json
- Tokens sync automatically with Figma styles
Handoff checklist
Reference: See references/developer-handoff.md
Tool Reference
design_token_generator.py
Generates complete design token system from brand color.
| Argument |
Values |
Default |
Description |
| brand_color |
Hex color |
#0066CC |
Primary brand color |
| style |
modern, classic, playful |
modern |
Design style preset |
| format |
json, css, scss, summary |
json |
Output format |
Examples:
# Generate JSON tokens (default)
python scripts/design_token_generator.py "#0066CC"
# Classic style with CSS output
python scripts/design_token_generator.py "#8B4513" classic css
# Playful style summary view
python scripts/design_token_generator.py "#FF6B6B" playful summary
Output Categories:
| Category |
Description |
Key Values |
| colors |
Color palettes |
primary, secondary, neutral, semantic, surface |
| typography |
Font system |
fontFamily, fontSize, fontWeight, lineHeight |
| spacing |
8pt grid |
0-64 scale, semantic (xs-3xl) |
| sizing |
Component sizes |
container, button, input, icon |
| borders |
Border values |
radius (per style), width |
| shadows |
Shadow styles |
none through 2xl, inner |
| animation |
Motion tokens |
duration, easing, keyframes |
| breakpoints |
Responsive |
xs, sm, md, lg, xl, 2xl |
| z-index |
Layer system |
base through notification |
Quick Reference Tables
Color Scale Generation
| Step |
Brightness |
Saturation |
Use Case |
| 50 |
95% fixed |
30% |
Subtle backgrounds |
| 100 |
95% fixed |
38% |
Light backgrounds |
| 200 |
95% fixed |
46% |
Hover states |
| 300 |
95% fixed |
54% |
Borders |
| 400 |
95% fixed |
62% |
Disabled states |
| 500 |
Original |
70% |
Base/default color |
| 600 |
Original × 0.8 |
78% |
Hover (dark) |
| 700 |
Original × 0.6 |
86% |
Active states |
| 800 |
Original × 0.4 |
94% |
Text |
| 900 |
Original × 0.2 |
100% |
Headings |
Typography Scale (1.25x Ratio)
| Size |
Value |
Calculation |
| xs |
10px |
16 ÷ 1.25² |
| sm |
13px |
16 ÷ 1.25¹ |
| base |
16px |
Base |
| lg |
20px |
16 × 1.25¹ |
| xl |
25px |
16 × 1.25² |
| 2xl |
31px |
16 × 1.25³ |
| 3xl |
39px |
16 × 1.25⁴ |
| 4xl |
49px |
16 × 1.25⁵ |
| 5xl |
61px |
16 × 1.25⁶ |
WCAG Contrast Requirements
| Level |
Normal Text |
Large Text |
| AA |
4.5:1 |
3:1 |
| AAA |
7:1 |
4.5:1 |
Large text: ≥18pt regular or ≥14pt bold
Style Presets
| Aspect |
Modern |
Classic |
Playful |
| Font Sans |
Inter |
Helvetica |
Poppins |
| Font Mono |
Fira Code |
Courier |
Source Code Pro |
| Radius Default |
8px |
4px |
16px |
| Shadows |
Layered, subtle |
Single layer |
Soft, pronounced |
Knowledge Base
Detailed reference guides in references/:
| File |
Content |
token-generation.md |
Color algorithms, HSV space, WCAG contrast, type scales |
component-architecture.md |
Atomic design, naming conventions, props patterns |
responsive-calculations.md |
Breakpoints, fluid typography, grid systems |
developer-handoff.md |
Export formats, framework setup, Figma sync |
Validation Checklist
Token Generation
Component System
Accessibility
Developer Handoff
When to Use
UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
Covers: Trigger Terms, Workflows, Workflow 1: Generate Design Tokens, Workflow 2: Create Component System, Workflow 3: Responsive Design.
1---2name: ui-design-system3description: UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.4license: MIT5---6# UI Design System78Generate design tokens, create color palettes, calculate typography scales, build component systems, and prepare developer handoff documentation.910---1112## Table of Contents1314- [Trigger Terms](#trigger-terms)15- [Workflows](#workflows)16 - [Workflow 1: Generate Design Tokens](#workflow-1-generate-design-tokens)17 - [Workflow 2: Create Component System](#workflow-2-create-component-system)18 - [Workflow 3: Responsive Design](#workflow-3-responsive-design)19 - [Workflow 4: Developer Handoff](#workflow-4-developer-handoff)20- [Tool Reference](#tool-reference)21- [Quick Reference Tables](#quick-reference-tables)22- [Knowledge Base](#knowledge-base)2324---2526## Trigger Terms2728Use this skill when you need to:2930- "generate design tokens"31- "create color palette"32- "build typography scale"33- "calculate spacing system"34- "create design system"35- "generate CSS variables"36- "export SCSS tokens"37- "set up component architecture"38- "document component library"39- "calculate responsive breakpoints"40- "prepare developer handoff"41- "convert brand color to palette"42- "check WCAG contrast"43- "build 8pt grid system"4445---4647## Workflows4849### Workflow 1: Generate Design Tokens5051**Situation:** You have a brand color and need a complete design token system.5253**Steps:**54551. **Identify brand color and style**56 - Brand primary color (hex format)57 - Style preference: `modern` | `classic` | `playful`58592. **Generate tokens using script**60 ```bash61 python scripts/design_token_generator.py "#0066CC" modern json62 ```63643. **Review generated categories**65 - Colors: primary, secondary, neutral, semantic, surface66 - Typography: fontFamily, fontSize, fontWeight, lineHeight67 - Spacing: 8pt grid-based scale (0-64)68 - Borders: radius, width69 - Shadows: none through 2xl70 - Animation: duration, easing71 - Breakpoints: xs through 2xl72734. **Export in target format**74 ```bash75 # CSS custom properties76 python scripts/design_token_generator.py "#0066CC" modern css > design-tokens.css7778 # SCSS variables79 python scripts/design_token_generator.py "#0066CC" modern scss > _design-tokens.scss8081 # JSON for Figma/tooling82 python scripts/design_token_generator.py "#0066CC" modern json > design-tokens.json83 ```84855. **Validate accessibility**86 - Check color contrast meets WCAG AA (4.5:1 normal, 3:1 large text)87 - Verify semantic colors have contrast colors defined8889---9091### Workflow 2: Create Component System9293**Situation:** You need to structure a component library using design tokens.9495**Steps:**96971. **Define component hierarchy**98 - Atoms: Button, Input, Icon, Label, Badge99 - Molecules: FormField, SearchBar, Card, ListItem100 - Organisms: Header, Footer, DataTable, Modal101 - Templates: DashboardLayout, AuthLayout1021032. **Map tokens to components**104105 | Component | Tokens Used |106 |-----------|-------------|107 | Button | colors, sizing, borders, shadows, typography |108 | Input | colors, sizing, borders, spacing |109 | Card | colors, borders, shadows, spacing |110 | Modal | colors, shadows, spacing, z-index, animation |1111123. **Define variant patterns**113114 Size variants:115 ```116 sm: height 32px, paddingX 12px, fontSize 14px117 md: height 40px, paddingX 16px, fontSize 16px118 lg: height 48px, paddingX 20px, fontSize 18px119 ```120121 Color variants:122 ```123 primary: background primary-500, text white124 secondary: background neutral-100, text neutral-900125 ghost: background transparent, text neutral-700126 ```1271284. **Document component API**129 - Props interface with types130 - Variant options131 - State handling (hover, active, focus, disabled)132 - Accessibility requirements1331345. **Reference:** See `references/component-architecture.md`135136---137138### Workflow 3: Responsive Design139140**Situation:** You need breakpoints, fluid typography, or responsive spacing.141142**Steps:**1431441. **Define breakpoints**145146 | Name | Width | Target |147 |------|-------|--------|148 | xs | 0 | Small phones |149 | sm | 480px | Large phones |150 | md | 640px | Tablets |151 | lg | 768px | Small laptops |152 | xl | 1024px | Desktops |153 | 2xl | 1280px | Large screens |1541552. **Calculate fluid typography**156157 Formula: `clamp(min, preferred, max)`158159 ```css160 /* 16px to 24px between 320px and 1200px viewport */161 font-size: clamp(1rem, 0.5rem + 2vw, 1.5rem);162 ```163164 Pre-calculated scales:165 ```css166 --fluid-h1: clamp(2rem, 1rem + 3.6vw, 4rem);167 --fluid-h2: clamp(1.75rem, 1rem + 2.3vw, 3rem);168 --fluid-h3: clamp(1.5rem, 1rem + 1.4vw, 2.25rem);169 --fluid-body: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);170 ```1711723. **Set up responsive spacing**173174 | Token | Mobile | Tablet | Desktop |175 |-------|--------|--------|---------|176 | --space-md | 12px | 16px | 16px |177 | --space-lg | 16px | 24px | 32px |178 | --space-xl | 24px | 32px | 48px |179 | --space-section | 48px | 80px | 120px |1801814. **Reference:** See `references/responsive-calculations.md`182183---184185### Workflow 4: Developer Handoff186187**Situation:** You need to hand off design tokens to development team.188189**Steps:**1901911. **Export tokens in required formats**192 ```bash193 # For CSS projects194 python scripts/design_token_generator.py "#0066CC" modern css195196 # For SCSS projects197 python scripts/design_token_generator.py "#0066CC" modern scss198199 # For JavaScript/TypeScript200 python scripts/design_token_generator.py "#0066CC" modern json201 ```2022032. **Prepare framework integration**204205 **React + CSS Variables:**206 ```tsx207 import './design-tokens.css';208209 <button className="btn btn-primary">Click</button>210 ```211212 **Tailwind Config:**213 ```javascript214 const tokens = require('./design-tokens.json');215216 module.exports = {217 theme: {218 colors: tokens.colors,219 fontFamily: tokens.typography.fontFamily220 }221 };222 ```223224 **styled-components:**225 ```typescript226 import tokens from './design-tokens.json';227228 const Button = styled.button`229 background: ${tokens.colors.primary['500']};230 padding: ${tokens.spacing['2']} ${tokens.spacing['4']};231 `;232 ```2332343. **Sync with Figma**235 - Install Tokens Studio plugin236 - Import design-tokens.json237 - Tokens sync automatically with Figma styles2382394. **Handoff checklist**240 - [ ] Token files added to project241 - [ ] Build pipeline configured242 - [ ] Theme/CSS variables imported243 - [ ] Component library aligned244 - [ ] Documentation generated2452465. **Reference:** See `references/developer-handoff.md`247248---249250## Tool Reference251252### design_token_generator.py253254Generates complete design token system from brand color.255256| Argument | Values | Default | Description |257|----------|--------|---------|-------------|258| brand_color | Hex color | #0066CC | Primary brand color |259| style | modern, classic, playful | modern | Design style preset |260| format | json, css, scss, summary | json | Output format |261262**Examples:**263264```bash265# Generate JSON tokens (default)266python scripts/design_token_generator.py "#0066CC"267268# Classic style with CSS output269python scripts/design_token_generator.py "#8B4513" classic css270271# Playful style summary view272python scripts/design_token_generator.py "#FF6B6B" playful summary273```274275**Output Categories:**276277| Category | Description | Key Values |278|----------|-------------|------------|279| colors | Color palettes | primary, secondary, neutral, semantic, surface |280| typography | Font system | fontFamily, fontSize, fontWeight, lineHeight |281| spacing | 8pt grid | 0-64 scale, semantic (xs-3xl) |282| sizing | Component sizes | container, button, input, icon |283| borders | Border values | radius (per style), width |284| shadows | Shadow styles | none through 2xl, inner |285| animation | Motion tokens | duration, easing, keyframes |286| breakpoints | Responsive | xs, sm, md, lg, xl, 2xl |287| z-index | Layer system | base through notification |288289---290291## Quick Reference Tables292293### Color Scale Generation294295| Step | Brightness | Saturation | Use Case |296|------|------------|------------|----------|297| 50 | 95% fixed | 30% | Subtle backgrounds |298| 100 | 95% fixed | 38% | Light backgrounds |299| 200 | 95% fixed | 46% | Hover states |300| 300 | 95% fixed | 54% | Borders |301| 400 | 95% fixed | 62% | Disabled states |302| 500 | Original | 70% | Base/default color |303| 600 | Original × 0.8 | 78% | Hover (dark) |304| 700 | Original × 0.6 | 86% | Active states |305| 800 | Original × 0.4 | 94% | Text |306| 900 | Original × 0.2 | 100% | Headings |307308### Typography Scale (1.25x Ratio)309310| Size | Value | Calculation |311|------|-------|-------------|312| xs | 10px | 16 ÷ 1.25² |313| sm | 13px | 16 ÷ 1.25¹ |314| base | 16px | Base |315| lg | 20px | 16 × 1.25¹ |316| xl | 25px | 16 × 1.25² |317| 2xl | 31px | 16 × 1.25³ |318| 3xl | 39px | 16 × 1.25⁴ |319| 4xl | 49px | 16 × 1.25⁵ |320| 5xl | 61px | 16 × 1.25⁶ |321322### WCAG Contrast Requirements323324| Level | Normal Text | Large Text |325|-------|-------------|------------|326| AA | 4.5:1 | 3:1 |327| AAA | 7:1 | 4.5:1 |328329Large text: ≥18pt regular or ≥14pt bold330331### Style Presets332333| Aspect | Modern | Classic | Playful |334|--------|--------|---------|---------|335| Font Sans | Inter | Helvetica | Poppins |336| Font Mono | Fira Code | Courier | Source Code Pro |337| Radius Default | 8px | 4px | 16px |338| Shadows | Layered, subtle | Single layer | Soft, pronounced |339340---341342## Knowledge Base343344Detailed reference guides in `references/`:345346| File | Content |347|------|---------|348| `token-generation.md` | Color algorithms, HSV space, WCAG contrast, type scales |349| `component-architecture.md` | Atomic design, naming conventions, props patterns |350| `responsive-calculations.md` | Breakpoints, fluid typography, grid systems |351| `developer-handoff.md` | Export formats, framework setup, Figma sync |352353---354355## Validation Checklist356357### Token Generation358- [ ] Brand color provided in hex format359- [ ] Style matches project requirements360- [ ] All token categories generated361- [ ] Semantic colors include contrast values362363### Component System364- [ ] All sizes implemented (sm, md, lg)365- [ ] All variants implemented (primary, secondary, ghost)366- [ ] All states working (hover, active, focus, disabled)367- [ ] Uses only design tokens (no hardcoded values)368369### Accessibility370- [ ] Color contrast meets WCAG AA371- [ ] Focus indicators visible372- [ ] Touch targets ≥ 44×44px373- [ ] Semantic HTML elements used374375### Developer Handoff376- [ ] Tokens exported in required format377- [ ] Framework integration documented378- [ ] Design tool synced379- [ ] Component documentation complete380381## When to Use382383UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.384385Covers: Trigger Terms, Workflows, Workflow 1: Generate Design Tokens, Workflow 2: Create Component System, Workflow 3: Responsive Design.