Lab 05: Design Tokens
Overview
Step 1: W3C Design Token Format
// tokens.json — W3C Community Group format
{
"color": {
"blue": {
"50": { "$value": "#eff6ff", "$type": "color", "$description": "Lightest blue" },
"100": { "$value": "#dbeafe", "$type": "color" },
"200": { "$value": "#bfdbfe", "$type": "color" },
"300": { "$value": "#93c5fd", "$type": "color" },
"400": { "$value": "#60a5fa", "$type": "color" },
"500": { "$value": "#3b82f6", "$type": "color", "$description": "Brand primary" },
"600": { "$value": "#2563eb", "$type": "color" },
"700": { "$value": "#1d4ed8", "$type": "color" },
"800": { "$value": "#1e40af", "$type": "color" },
"900": { "$value": "#1e3a8a", "$type": "color", "$description": "Darkest blue" }
},
"gray": {
"50": { "$value": "#f9fafb", "$type": "color" },
"100": { "$value": "#f3f4f6", "$type": "color" },
"500": { "$value": "#6b7280", "$type": "color" },
"900": { "$value": "#111827", "$type": "color" }
}
},
"spacing": {
"1": { "$value": "4px", "$type": "dimension" },
"2": { "$value": "8px", "$type": "dimension" },
"3": { "$value": "12px", "$type": "dimension" },
"4": { "$value": "16px", "$type": "dimension" },
"6": { "$value": "24px", "$type": "dimension" },
"8": { "$value": "32px", "$type": "dimension" }
},
"border-radius": {
"none": { "$value": "0px", "$type": "dimension" },
"sm": { "$value": "4px", "$type": "dimension" },
"md": { "$value": "8px", "$type": "dimension" },
"lg": { "$value": "12px", "$type": "dimension" },
"xl": { "$value": "16px", "$type": "dimension" },
"full": { "$value": "9999px", "$type": "dimension" }
},
"font-size": {
"xs": { "$value": "12px", "$type": "dimension" },
"sm": { "$value": "14px", "$type": "dimension" },
"md": { "$value": "16px", "$type": "dimension" },
"lg": { "$value": "18px", "$type": "dimension" },
"xl": { "$value": "20px", "$type": "dimension" },
"2xl": { "$value": "24px", "$type": "dimension" },
"3xl": { "$value": "30px", "$type": "dimension" },
"4xl": { "$value": "36px", "$type": "dimension" }
}
}Step 2: Three-Tier Token Architecture
Step 3: Style Dictionary Configuration
Step 4: Platform Output Examples
Step 5: Dark Mode Token Overrides
Step 6: Component Token Usage
Step 7: Token Naming Conventions
Step 8: Capstone — Style Dictionary Token Transformer
Summary
Concept
W3C Token Format
Tool
Last updated
