SCSS
CSS custom properties + utility classes
File: src/styles/_design-tokens-figma.scss
This guide describes the comprehensive design tokens extracted from Figma and available in multiple formats for seamless integration with your components and styles.
Design tokens extracted from Figma are available in multiple formats to support different use cases:
SCSS
CSS custom properties + utility classes
File: src/styles/_design-tokens-figma.scss
TypeScript
Type-safe token definitions
File: src/styles/tokens/tokens.ts
JSON
W3C DTCG standard format
File: src/styles/tokens/tokens.json
CSS
Raw CSS custom properties
File: src/styles/tokens/tokens.css
Total Tokens: 35+
| Token | Value | Description |
|---|---|---|
--figma-color-primary-brand | #044076 | Primary brand color |
| Token | Value | Description |
|---|---|---|
--figma-color-secondary-indigo | #9f9ff8 | Secondary indigo |
--figma-color-secondary-mint | #96e2d6 | Secondary mint |
--figma-color-secondary-blue | #92bfff | Secondary blue |
--figma-color-secondary-cyan | #aec7ed | Secondary cyan |
--figma-color-secondary-green | #94e9b8 | Secondary green |
--figma-color-secondary-sky-blue | #56CCF2 | Secondary sky blue |
| Token | Value | Description |
|---|---|---|
--figma-color-grey-white | #FFFFFF | Grey white (100%) |
--figma-color-grey-50 | #D0D1D2 | Grey 50 |
--figma-color-grey-40 | #A2A3A5 | Grey 40 |
--figma-color-grey-2 | #909090 | Grey 2 |
| Token | Value | Description |
|---|---|---|
--figma-color-black-100 | #000000 | Black 80% opacity |
--figma-color-black-40 | #00000066 | Black 40% opacity |
--figma-color-black-light | #11263C | Light black |
--figma-color-black-font | #303030 | Black font color |
| Token | Value | Description |
|---|---|---|
--figma-color-white-100 | #FFFFFF | White 100% |
| Token | Value | Description |
|---|---|---|
--figma-color-error | #EB5757 | Error red color |
Based on a 4px grid system:
| Token | Value | Multiplier | Description |
|---|---|---|---|
--figma-spacing-1 | 4px | 1× | Base unit |
--figma-spacing-2 | 8px | 2× | Small spacing |
--figma-spacing-4 | 16px | 4× | Medium spacing |
--figma-spacing-6 | 24px | 6× | Large spacing |
--figma-spacing-7 | 28px | 7× | Extra large spacing |
| Token | Value | Description |
|---|---|---|
--figma-font-family-inter | Inter, system-ui, -apple-system, sans-serif | Inter with fallbacks |
--figma-font-family-poppins | Poppins, system-ui, -apple-system, sans-serif | Poppins with fallbacks |
| Token | Value | Description |
|---|---|---|
--figma-font-weight-regular | 400 | Regular weight |
| Token | Value | Description |
|---|---|---|
--figma-letter-spacing-normal | 0 | Normal spacing |
Each typography style is expanded into individual properties for easier CSS usage:
--figma-typography-body-small-font-family--figma-typography-body-small-font-size (12px)--figma-typography-body-small-font-weight (400)--figma-typography-body-small-line-height (20px)--figma-typography-body-label-font-family--figma-typography-body-label-font-size (8px)--figma-typography-body-label-font-weight (400)--figma-typography-body-label-line-height (12px)--figma-typography-body-input-font-family--figma-typography-body-input-font-size (14px)--figma-typography-body-input-font-weight (400)--figma-typography-body-input-line-height (22px)--figma-typography-text-12-regular-font-family--figma-typography-text-12-regular-font-size (12px)--figma-typography-text-12-regular-font-weight (400)--figma-typography-text-12-regular-line-height (16px)@use "../styles/design-tokens-figma";
.my-component { background-color: var(--figma-color-secondary-mint); padding: var(--figma-spacing-6); color: var(--figma-color-black-font);}import { tokens } from '#styles/tokens/tokens'
const MyComponent = () => { return ( <div style={{ backgroundColor: tokens.color.secondary.mint, padding: tokens.spacing['6'] }}> Content </div> )}---import '#styles/design-tokens-figma.scss'---
<div class="card"> <h2 class="figma-body-input">Card Title</h2> <p class="figma-body-small">Card content</p></div>
<style> .card { background-color: var(--figma-color-white-100); border: 1px solid var(--figma-color-grey-50); padding: var(--figma-spacing-6); border-radius: 8px; }</style>.my-text { font-family: var(--figma-typography-body-small-font-family); font-size: var(--figma-typography-body-small-font-size); font-weight: var(--figma-typography-body-small-font-weight); line-height: var(--figma-typography-body-small-line-height);}The SCSS file includes pre-built utility classes:
<p class="figma-body-small">Small body text</p><label class="figma-body-label">Label text</label><input class="figma-body-input" type="text" /><span class="figma-text-12-regular">Regular text</span>The Figma tokens use a --figma- prefix to avoid conflicts with existing design tokens in _design-tokens.scss.
You can create aliases to map Figma tokens to your design system:
:root { /* Map Figma tokens to semantic names */ --brand-primary: var(--figma-color-primary-brand); --brand-accent-mint: var(--figma-color-secondary-mint); --brand-accent-blue: var(--figma-color-secondary-blue);
/* Typography shortcuts */ --text-small: var(--figma-typography-body-small-font-size); --font-body: var(--figma-font-family-poppins); --font-heading: var(--figma-font-family-inter);}To extract updated tokens from Figma:
figma-design-tokens skillThe tokens.json file follows the W3C Design Tokens Community Group specification:
{ "color": { "primary": { "brand": { "$type": "color", "$value": "#044076", "$description": "Primary brand color" } } }, "spacing": { "6": { "$type": "dimension", "$value": "24px", "$description": "Spacing 6 (24px)" } }}Benefits:
The TypeScript definitions provide type-safe access to tokens:
import { tokens } from '#styles/tokens/tokens'
// Fully typed - autocomplete works!const brandColor = tokens.color.primary.brand // '#044076'const mintColor = tokens.color.secondary.mint // '#96e2d6'const spacing = tokens.spacing['6'] // '24px'const fontFamily = tokens.fontFamily.poppins // 'Poppins'Benefits:
Figma tokens follow a semantic naming convention:
--figma-color-primary-{name}--figma-color-secondary-{name}--figma-color-grey-{scale}--figma-color-black-{variant}--figma-color-{semantic}--figma-spacing-{multiplier}--figma-spacing-6 = 24px (6 × 4px base)--figma-font-family-{name}--figma-typography-{style}-{property}--figma-typography-body-small-font-sizeAll generated tokens are validated for W3C DTCG specification compliance:
✅ Validation Checks:
$type and $value properties presentsrc/styles/├── _design-tokens-figma.scss # Main Figma tokens file (35+ tokens)├── tokens/│ ├── tokens.css # CSS custom properties│ ├── tokens.ts # TypeScript definitions│ └── tokens.json # W3C DTCG format└── _design-tokens.scss # Existing design tokens (kept separate)Extract additional token types from Figma:
If your Figma file uses variable modes (light/dark themes):
Integrate tokens into your build pipeline:
Problem: Extraction returns empty or limited results
Solutions:
Problem: Some expected tokens aren’t extracted
Solutions:
Problem: Typography tokens don’t apply correctly
Solutions:
.figma-body-small)Last Updated: 2025-01-22 Extraction Source: Figma Desktop MCP Server Format: W3C Design Tokens Community Group (DTCG) Total Tokens: 35+ Categories: Colors, Spacing, Typography, Fonts