Wylie Dog
05 · Token Bridge·v0.2.0 · beta

One source of truth. No manual handoff.

Token Bridge syncs @wyliedog/tokens to Figma Variables — so design references the same contract as code. When a value moves in the repo, the next sync moves Figma with it.

$pnpm sync:figma·2.1s · 1184 variablessynced
Live pipeline

source

@wyliedog/tokens

v1.4.0

--color-interactive
--color-success
--color-warning
+183 more

transform

Token Bridge

v0.9.2

Mapping … 1089/1184

target

Figma Variables

Wylie Dog · UI

Primitives268
Semantic122
Components794
● synced4s ago
Light mode1184 vars
Dark mode1184 vars
Variables synced
1184
Avg sync time
2.1s
Manual handoffs
0
Drift
none
How it works
Five steps from JSON to Figma
01

JSON source

All 1184 design tokens live in a single source-of-truth JSON file inside the monorepo — color, type, spacing, radius, elevation, and motion. Every token is OKLCH, every value is intentional.

packages/tokens/tokens.json
"color": {
"interactive": {
"primary": "oklch(0.54 0.18 274)"
"primary-hover": "oklch(0.50 0.18 274)"
}
215 more color tokens
}
02

Trigger the sync

One command reads the token JSON, transforms every value, and opens a connection to the Figma Variables API. No browser plugins, no manual copy-paste, no export steps.

Terminal
$ pnpm sync:figma
✓ Loaded 1184 tokens from tokens.json
✓ Connected to Figma Variables API
✓ Mapped 216 color tokens
✓ Syncing Light + Dark modes…
✓ Done in 2.1s · 1184/1184 synced
03

Map CSS → Figma hierarchy

Token Bridge translates the flat CSS variable namespace into Figma's three-tier collection structure: Primitives, Semantic, and Components. The mapping is deterministic — no manual configuration.

P
Primitives · 268 tokens
Raw OKLCH values
S
Semantic · 122 tokens
Role-based aliases
C
Components · 794 tokens
Component-scoped
04

Light + dark modes

Token Bridge writes both modes in a single pass. Every color token gets a Light value and a Dark value. Figma's mode switching reflects your code's theme switching exactly.

Token
Light
Dark
--color-bg-primary
oklch(1 0 0)
oklch(0.13 0.01 274)
--color-text-primary
oklch(0.15 0.01 274)
oklch(0.97 0.004 274)
--color-border
oklch(0.88 0.008 274)
oklch(0.26 0.01 274)
05

Propagate to components

Once Figma Variables are updated, every component in the Figma library that references those variables reflects the new values instantly — no relinking, no frame-by-frame updates.

Button · Primary
Before
After
Token updated from 0.58 0.54 lightness. Propagated to all 794 component-scoped references.
What syncs
Category
Tokens
Modes
Notes
Color
216
2
OKLCH · P3 wide gamut
Typography
33
1
Family, size, weight, line-height
Spacing
22
1
4px base grid
Radius
7
1
None → full
Elevation
30
2
Shadow scale · light + dark
Motion
9
1
Duration + easing
~/wyliedog/ui — zsh100×34
~/wyliedog/uipnpm sync:figma
@wyliedog/token-bridge v0.9.2
↳ Reading @wyliedog/tokens v1.4.0
↳ Connecting to Figma file Wylie Dog · UI
Authenticated as travis@wyliedog.dev
3 collections discovered (Primitives, Semantic, Components)
2 modes confirmed (Light, Dark)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Primitives 268 vars +2 ~0 -0
└─ palette/blue ~1 oklch(58 .16 274) → oklch(54 .18 274)</div>
└─ palette/slate +1 slate/25 (new)
Semantic 122 vars +1 ~0 -0
└─ Light mode 122
└─ Dark mode 122
└─ surface/elevated +1 new in v1.4
Components 794 vars ~0 ~0 -0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1184 variables synced in 2.14s
3 changes · 0 conflicts · 0 detached layers
Open in Figma → figma.com/file/wyliedog-ui?variables
~/wyliedog/ui
.github/workflows/tokens.ymlruns on push to main
- name: Sync design tokens to Figma
  if: contains(github.event.head_commit.modified, 'packages/tokens')
  run: pnpm sync:figma
  env:
    FIGMA_TOKEN: ${{ secrets.FIGMA_BRIDGE_TOKEN }}
For engineers

One command. No GUI required.

Token Bridge runs from anywhere a pnpm script can: your laptop, CI, a release workflow, a pre-commit hook. The output is diff-able, the auth is keychain-managed, and a dry-run flag previews changes before they hit the file.

installpnpm add -D @wyliedog/token-bridge
initpnpm bridge init
syncpnpm sync:figma
previewpnpm sync:figma --dry-run

Requires Node 20+ and a Figma file with editor access. The bridge talks to Figma's REST Variables API — no plugin install.

Result in Figma

Variables panel,
fully populated.

After one sync, the Figma Variables panel shows all 1184 tokens organized into three collections with Light and Dark modes populated. Designers use real token names — not hex codes, not guesses.

Tokens are live-linked — update JSON, re-run sync, Figma updates
Both modes populated in a single pass
No manual variable creation or relinking required
Figma — Local Variables
Collections
Primitives
268 tokens
Semantic
122 tokens
Components
794 tokens
Modes
Light
Dark
Name
Light
Dark
--color-bg-primary
oklch(1 0 0)
oklch(0.13 0.01 274)
--color-text-primary
oklch(0.15 0.01 274)
oklch(0.97 0.004 274)
--color-interactive
oklch(0.54 0.18 274)
oklch(0.62 0.18 274)
--color-border
oklch(0.88 0.008 274)
oklch(0.26 0.01 274)
--color-success
oklch(0.60 0.14 155)
oklch(0.68 0.14 155)
+ 119 more semantic tokens

Keep design and code in sync.

Set it up once, forget it forever. Your designers stop asking which value is current, your engineers stop chasing drift, and your tokens become the single thing that's actually true.