Exporting design tokens
Learn

Exporting design tokens from Figma: formats, tools and workflows

Author Avatar
Written by
Jun 23, 2026

Getting variables out of Figma and into a form that code can consume is one of the most friction-prone steps in the design token pipeline. The variables exist in Figma. The components need CSS custom properties, Swift constants, or Android resource values. The gap between those two things requires a deliberate workflow. The choice of tools determines how smooth or painful that workflow is.

This article covers the main export paths: what Figma's native export produces and where it falls short, how Tokens Studio bridges design to version control, how zeroheight's token manager fits into the picture, and how Style Dictionary handles the transformation from exported JSON to platform-specific outputs. It finishes with the full automated workflow and the format decisions you'll face along the way.

For the broader pipeline context — version control, CI/CD, semantic versioning, and distribution — Article 11 — The design token pipeline covers that end to end. This article focuses on the Figma-specific leg of the journey.

Native Figma export: what it produces and where it falls short

Figma has a built-in REST API that exposes variable data from a file. With the right access token, you can query a file's variables and get back a JSON response containing the collection structure, variable names, types, values, and mode definitions.

This is useful but incomplete as a production export path. The native API output is Figma's internal representation. It's not structured as DTCG-compliant token JSON, alias references are expressed as Figma's internal variable IDs rather than human-readable paths, and there's no transformation layer to produce platform-specific outputs.

Native API access works well for scripting custom export workflows, building integrations, or accessing variable data programmatically. It's not suited to dropping into a codebase directly or passing to Style Dictionary without significant pre-processing.

For most teams, native API access is the foundation that other tools build on, not the export method itself.

Tokens Studio: JSON output and GitHub sync

Tokens Studio (formerly Figma Tokens) is a Figma plugin that stores design tokens in a structured JSON format and syncs them directly to version control. It's the most widely used tool for bridging the design tool and the token pipeline.

The workflow looks like this: you define your tokens inside Tokens Studio rather than (or in addition to) native Figma variables, Tokens Studio stores them as a JSON file that maps to your token structure, and sync is configured to push that file to a GitHub, GitLab, or Bitbucket repository. When a designer updates a value and syncs, the change appears as a commit in the repository, ready for code review and pipeline processing.

Tokens Studio exports in its own JSON format by default, but it also supports DTCG-compatible output. The choice of format matters for what comes next: DTCG output is the better option if your transformation pipeline (Style Dictionary v4 or later, or other DTCG-aware tools) can consume it natively. Tokens Studio's proprietary format requires a pre-processing step before DTCG-aware tools can work with it.

The main advantages of Tokens Studio: it works well for teams that want to manage tokens primarily in a plugin rather than native Figma variables, it has mature sync with all major Git platforms, and it has a large community and extensive documentation. The trade-off is that it's a separate system sitting alongside Figma rather than native to it. Tokens live in the plugin, not in Figma's Variables panel, so they're not available as native variables in the canvas unless you sync them back.

For teams already deep into native Figma variables, Tokens Studio works best as an export bridge rather than a primary authoring tool.

zeroheight's token manager: documentation-first export

zeroheight's design token manager takes a different approach to the export problem. Rather than focusing on Git sync as the primary mechanism, it positions documentation as the central node: variables are imported from Figma via the zeroheight plugin, documented in a styleguide, and then exported from there to a range of platform formats.

The export options include CSS, SCSS, JavaScript, JSON, Android resource values, and iOS constants, as well as a Style Dictionary format that consuming projects can pull via a URL directly into their build process. This URL-based distribution is useful for projects that want to stay in sync with the latest token values without managing a separate package release cycle.

The workflow: a designer updates a variable value in Figma, uses the zeroheight plugin to push the change, and the update propagates to any project that pulls from the zeroheight export URL. Documentation in the styleguide updates at the same time, so developers can see the current values and their intended usage in one place.

This approach works well for teams where the documentation layer is a priority alongside the code integration, particularly design system teams who want designers, developers, and other stakeholders all working from the same documented source. It's less suited to teams who want full pipeline control through a Git-native workflow.

zeroheight also supports import and export to GitLab and Bitbucket in addition to GitHub, and the token manager is available on the free plan, making it accessible without a paid subscription.

Style Dictionary: from exported JSON to platform outputs

Regardless of which tool you use to get tokens out of Figma, the transformation step (converting platform-agnostic JSON into platform-specific code) is typically handled by Style Dictionary.

Style Dictionary takes a JSON token source and produces whatever outputs you configure. One build command can generate CSS custom properties for web, Swift constants for iOS, and Android XML resource values simultaneously. Article 12 covers Style Dictionary configuration in detail; for the purposes of this article, the key point is that Style Dictionary expects a specific input format, and what you get out of Figma (or Tokens Studio, or zeroheight) needs to match what Style Dictionary expects before it can process it.

This is where format choice matters most. Style Dictionary v4 supports DTCG format natively, meaning DTCG-compliant input can be processed directly. Earlier versions, and some configurations of v4, expect a flatter format without $value and $type wrappers. Knowing which version you're using and what input format it expects before you set up your export workflow avoids a common source of pipeline failures.

A common pre-processing step when working with Figma-exported JSON is flattening the nested structure and resolving aliases before passing the output to Style Dictionary:

js

// Input: nested DTCG with alias references
"color/action/primary": {
  "$type": "color",
  "$value": "{color/blue/500}"
}

// After pre-processing: flat, alias resolved
"color-action-primary": "#3B82F6"

Style Dictionary can handle some of this natively through its transform pipeline, but complex alias structures or non-standard naming conventions often need a custom transform step. Article 12 covers writing custom transforms in detail.

The full workflow: Figma to code

Putting it together, a typical Figma-to-code workflow looks like:

1. Figma (source)
   Designer updates variable values in Figma Variables

2. Export bridge
   Tokens Studio plugin syncs JSON to GitHub
   — or —
   zeroheight plugin imports to token manager, exports via URL

3. Version control
   Token JSON lives in a Git repository
   Changes go through pull request review

4. Transformation
   Style Dictionary runs on merge to main
   Outputs: CSS (web), Swift (iOS), XML (Android)

5. Distribution
   Platform-specific packages published (npm, CocoaPods, Maven)
   Consuming projects pull updated packages

6. Documentation
   Token documentation updated in styleguide
   Developers can browse current values and usage guidance

The critical discipline throughout: nothing in the codebase should reference Figma-exported JSON directly. The exported file is input to the transformation step, not a file that ships to production. What ships is the Style Dictionary output: CSS custom properties, Swift constants, whatever the platform needs.

Automating the Figma-to-code loop

The workflow above becomes significantly more reliable when automated. Manual export steps are easy to forget or skip under deadline pressure; automated steps run every time regardless.

A GitHub Actions workflow that triggers on changes to the token source file and runs the Style Dictionary build covers most of the automation need. What makes the Figma-specific part harder to automate is the design tool export step. Getting changes from Figma into the repository still requires a human action, either a plugin sync (Tokens Studio, zeroheight) or a manual API call.

The most mature automation setups handle this with a two-stage process: designers trigger the export from Figma (via plugin), which opens a pull request in the repository with the token changes. An engineer reviews and merges the PR. The CI/CD pipeline then runs automatically on merge, transforming and distributing the updated tokens. This keeps human review in the loop for token changes (which are design decisions, not just code changes) while automating everything downstream of that review.

Format considerations: DTCG vs proprietary JSON

The design token export landscape currently has two main format families, and the choice affects compatibility with your tooling.

DTCG format uses $value and $type wrappers and is the format supported by the W3C Design Tokens Community Group specification. It's the direction the industry is moving, and Style Dictionary v4, Tokens Studio (with the right configuration), and most new tooling support it. If you're starting a new pipeline today, DTCG is the right default.

Proprietary JSON includes Tokens Studio's native format, various tool-specific structures, and the flattened JSON that older pipelines often use. These formats vary in how they express aliases, composite values, and metadata. If your existing tooling expects a specific format, you may need a format conversion step before you can adopt DTCG.

The practical advice: check what format your export tool produces and what format your transformation tool expects before you build the pipeline. Discovering a format mismatch after you've configured Style Dictionary and written custom transforms is a frustrating rework.

What comes next

Section 6 moves from Figma-specific workflows to zeroheight-specific ones. Article 18 — Setting up design tokens in zeroheight covers how to connect your token source to zeroheight, set up token documentation pages, and keep documentation in sync as tokens change.

For the full pipeline picture — source of truth decisions, versioning, CI/CD, and the tooling comparison — Article 11 — The design token pipeline covers that end to end.

Author Avatar
Try zeroheight
The design systems platform that keeps teams and agents in sync
Start for free
Share this post