Figma variables and the token files, in sync.
Token Bridge is a Figma plugin that pulls the token files in @wyliedog/tokens into Figma Variables and pushes your edits back to GitHub, either as a direct commit or as a pull request.
Collections it syncs
- primitive286 tokens · Value
- semantic102 tokens · Light, Dark
- components1132 tokens · Light, Dark
1,520 tokens total
How it works
Five steps from the repository to Figma and back
- 01
Install the plugin in Figma
Token Bridge is a Figma plugin. Build it from apps/figma-plugin, then in the Figma desktop app choose Plugins, Development, Import plugin from manifest, and select manifest.json.
- 02
Connect a GitHub repository
Enter the owner, repository, branch and the folder that holds the token files (here, packages/tokens/io/sync), plus a GitHub personal access token with the repo scope, or Contents read and write for a fine-grained token. The token is stored per Figma user and is never written into the file.
- 03
Pull tokens into Figma
Pull reads the token files from GitHub, or import a file from disk. The format is detected automatically and a summary is shown before anything changes. The 1,520 tokens become three variable collections: primitive, semantic and components.
- 04
Edit variables in Figma
Designers work with the real token names. Semantic and component collections carry a Light and a Dark mode, matching the token files.
- 05
Push back to the repository
Select collections and push. In direct mode the files are committed to the configured branch; in pull-request mode they go to a new branch and a pull request opens. If the remote changed too, each conflict is shown and you keep the Figma value or take the GitHub value, one by one or in bulk.
What syncs
Three files, three collections
| File in packages/tokens/io/sync | Collection | Tokens | Modes | Holds |
|---|---|---|---|---|
| primitive.json | primitive | 286 | Value | Raw values: color scales in OKLCH, spacing, type, radius, shadow and motion scales. |
| semantic.json | semantic | 102 | Light, Dark | Role-based aliases in three groups: background, foreground and border, with tones for primary, danger, success and warning. |
| components.json | components | 1132 | Light, Dark | Component-scoped tokens that alias the semantic collection. |
Light and dark
Both modes live in the semantic collection
These values are read from the built token CSS, so this table changes when the tokens do.
| Token | Light | Dark |
|---|---|---|
| --color-background-default | oklch(0.991 0.003 264.36) | oklch(0.138 0.008 60.23) |
| --color-foreground-default | oklch(0.202 0.011 47.84) | oklch(0.977 0.003 65.02) |
| --color-background-primary | oklch(0.508 0.139 37.8) | oklch(0.508 0.139 37.8) |
| --color-border-default | oklch(0.74 0.019 69.96) | oklch(0.397 0.018 63.78) |
| --color-foreground-success-muted | oklch(0.488 0.134 150.16) | oklch(0.714 0.182 151.81) |
Worth knowing
What it does and does not do
- Unsupported variables are listed, not exported
- Native EASING and TIMING variables, composed colors, and anything that aliases them cannot be exported yet. After an export or push, a notice lists what was skipped and why.
- Tokens stay out of the file
- The GitHub token lives in Figma's per-user storage. The file's plugin data holds only the repository settings, so a shared or duplicated file does not carry a credential.
- Formats it can read
- W3C DTCG, Tokens Studio, Style Dictionary (flat and nested) and the native format used by this repository. Export always writes the native format, one JSON file per collection.
- Narrow network access
- The plugin manifest allows only api.github.com, raw.githubusercontent.com and Google Fonts.
GitHub is the only supported provider, and a personal access token is the only sign-in method.