Export your design variables, colors, typography, and spacing as design tokens in multiple formats for use in development.
What Are Design Tokens?
Design tokens are the smallest pieces of your design system:
- Colors (brand, semantic, palette)
- Typography (sizes, weights, families)
- Spacing (margins, padding, gaps)
- Shadows and effects
- Border radius and widths
Export Formats
CSS Custom Properties
:root {
--color-primary: #7c3aed;
--color-secondary: #ec4899;
--spacing-md: 16px;
--font-size-lg: 18px;
}
Sass/SCSS Variables
$color-primary: #7c3aed;
$color-secondary: #ec4899;
$spacing-md: 16px;
$font-size-lg: 18px;
JSON (Style Dictionary)
{
"color": {
"primary": { "value": "#7c3aed" },
"secondary": { "value": "#ec4899" }
},
"spacing": {
"md": { "value": "16px" }
}
}
JavaScript/TypeScript
export const tokens = {
color: {
primary: '#7c3aed',
secondary: '#ec4899',
},
spacing: {
md: '16px',
},
};
Tailwind CSS Config
module.exports = {
theme: {
extend: {
colors: {
primary: '#7c3aed',
secondary: '#ec4899',
},
},
},
};
Exporting Tokens
From Variables Panel
- Open Variables panel
- Click export button in header
- Select format
- Choose collections to include
- Download or copy
From Design System Panel
- Open Design System panel
- Go to Export tab
- Configure export options
- Select token categories
- Export
From File Menu
- File > Export > Design Tokens
- Choose format and options
- Save file
Export Options
Token Categories
- Colors only
- Typography only
- Spacing only
- All tokens
- Custom selection
Naming Convention
- kebab-case - color-primary
- camelCase - colorPrimary
- snake_case - color_primary
- PascalCase - ColorPrimary
Theme Handling
- Single theme export
- All themes in one file
- Separate file per theme
Presets
Quick export configurations:
- Web (CSS) - CSS custom properties
- Web (Sass) - SCSS variables
- React/Vue - JS/TS exports
- Tailwind - Tailwind config
- iOS (Swift) - Swift constants
- Android (Kotlin) - Kotlin resources
Using Exported Tokens
CSS
.button {
background: var(--color-primary);
padding: var(--spacing-md);
}
JavaScript
import { tokens } from './tokens';
const styles = {
backgroundColor: tokens.color.primary,
};
Best Practices
- Export tokens as part of build process
- Keep token names consistent with code
- Include descriptions in JSON exports
- Version your token exports
- Use Style Dictionary for complex setups
- Automate token sync with CI/CD