Design Tokens Workflow Tutorial
Learn the complete workflow for managing design tokens between Figma and GitHub.
Time: 20 minutes Difficulty: Beginner
What You'll Learn
- Set up a tokens repository structure
- Create and organize tokens in JSON
- Pull tokens to create Figma Variables
- Modify tokens in Figma
- Push changes back to GitHub
- Review changes via Pull Requests
Prerequisites
- GitFig installed and authenticated
- A GitHub repository (we'll create one)
- Basic familiarity with Figma Variables
Step 1: Create Repository Structure
Create a new repository with this structure:
design-tokens/
├── tokens/
│ ├── colors.json
│ ├── spacing.json
│ └── typography.json
└── README.md
Step 2: Define Your Tokens
colors.json
{
"brand": {
"primary": {
"$value": "#0066FF",
"$type": "color",
"$description": "Primary brand color for CTAs"
},
"secondary": {
"$value": "#6B7280",
"$type": "color",
"$description": "Secondary text and borders"
}
},
"background": {
"default": {
"$value": "#FFFFFF",
"$type": "color"
},
"surface": {
"$value": "#F9FAFB",
"$type": "color"
}
},
"text": {
"primary": {
"$value": "#111827",
"$type": "color"
},
"secondary": {
"$value": "#6B7280",
"$type": "color"
}
}
}
spacing.json
{
"spacing": {
"xs": { "$value": 4, "$type": "number" },
"sm": { "$value": 8, "$type": "number" },
"md": { "$value": 16, "$type": "number" },
"lg": { "$value": 24, "$type": "number" },
"xl": { "$value": 32, "$type": "number" }
}
}
Step 3: Connect and Configure
- Open GitFig in Figma
- Connect to your repository
- Configure mappings:
tokens/colors.json→ Variablestokens/spacing.json→ Variables
Step 4: Pull Tokens
Click Pull to create Variables from your JSON files.
Check the Variables panel - you should see:
brand/primary,brand/secondarybackground/default,background/surfacetext/primary,text/secondaryspacing/xsthroughspacing/xl
Step 5: Use Tokens in Your Designs
Apply variables to your design elements:
- Select a shape
- Click the variable icon in the Fill property
- Choose a color variable
Step 6: Modify Tokens
Change the primary brand color:
- Open Variables panel
- Edit
brand/primary - Change to
#FF6600
Step 7: Push Changes
- Click Push in GitFig
- Enter message: "Update primary brand color to orange"
- Push to GitHub
Step 8: Verify on GitHub
Open your repository and check tokens/colors.json. The primary color should be updated.
Next Steps
- Try the Multi-Brand Themes tutorial
- Learn about Branch Workflows