create_token
Creates a new design token within a specific mode of a tokenset.Tool Schema
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tokenset_id | string | Yes | The ID of the tokenset |
mode_id | string | Yes | The ID of the mode |
name | string | Yes | The name of the token (e.g., “color.primary”) |
type | string | Yes | The token type (see supported types below) |
value | string | Yes | The value of the token |
description | string | No | Optional description of the token |
alias_to | string | No | Optional token name to reference (for aliases) |
Supported Token Types
| Type | Description | Example Value |
|---|---|---|
color | Color values | #FF0000, rgb(255,0,0) |
dimension | Spacing, sizing | 16px, 1rem, 2em |
fontFamily | Font family names | Inter, Arial, sans-serif |
fontWeight | Font weight values | 400, bold, normal |
fontSize | Font sizes | 16px, 1.25rem |
lineHeight | Line height values | 1.5, 24px |
letterSpacing | Letter spacing | 0.5px, -0.02em |
duration | Time durations | 200ms, 0.3s |
cubicBezier | Easing curves | cubic-bezier(0.4, 0, 0.2, 1) |
number | Numeric values | 42, 3.14 |
string | Text values | "Hello World" |
boolean | True/false values | true, false |
strokeStyle | Border styles | solid, dashed |
border | Border definitions | 1px solid #000 |
transition | CSS transitions | all 0.3s ease |
shadow | Box shadows | 0 2px 4px rgba(0,0,0,0.1) |
gradient | CSS gradients | linear-gradient(to right, #fff, #000) |
typography | Complete text styles | Complex typography object |
Response
Example Usage in Claude
Create a Color Token
Create an Alias Token
Create Different Token Types
Token Naming Conventions
Use consistent naming patterns:color.primary,color.secondaryspacing.sm,spacing.md,spacing.lgfont.size.sm,font.size.lgborder.radius.sm,border.radius.lg
Aliases vs Direct Values
- Direct tokens: Have their own
value(e.g.,color.primary: "#007AFF") - Alias tokens: Reference other tokens by
name(e.g.,color.brand→color.primary)
Common Use Cases
1. Brand Colors
2. Spacing System
3. Typography Scale
4. Component Tokens
Notes
- Token names must be unique within a mode
- Aliased tokens automatically resolve to their referenced token’s value
- You can create tokens in any mode, allowing different values per theme
- Use descriptive names that follow your design system conventions
See Also
- list_tokens_by_mode - View tokens in a mode
- get_token - Get token details
- update_token - Modify existing tokens
- create_mode - Create modes for different themes