/

Open source

Open source

2024

Figma API, TypeScript

Token sync plugin

Keeps Figma and code tokens in sync.

Camera report

Scene

Open source

Year

2024

Tools

Figma API, TypeScript

The idea

Every team I worked with had two sets of design tokens: the ones in Figma and the ones in code, slowly drifting apart.

I wanted one button that makes them the same again, in either direction, with a readable diff before anything changes.

How it's built

A Figma plugin written in TypeScript. It reads local variables, writes a tokens.json in the W3C format and opens a pull request through the GitHub API.

  • Reads Figma variables and modes, not styles

  • Shows a diff before writing anything

  • Opens a pull request instead of pushing to main

  • Open source, used by eleven teams I know of

const vars = await figma.variables.getLocalVariablesAsync()
const tokens = Object.fromEntries(vars.map((v) => [
  v.name.replace(/\//g, "."),
  { $type: v.resolvedType.toLowerCase(), $value: v.valuesByMode[modeId] }
]))
figma.ui.postMessage({ type: "diff", tokens })
const vars = await figma.variables.getLocalVariablesAsync()
const tokens = Object.fromEntries(vars.map((v) => [
  v.name.replace(/\//g, "."),
  { $type: v.resolvedType.toLowerCase(), $value: v.valuesByMode[modeId] }
]))
figma.ui.postMessage({ type: "diff", tokens })
const vars = await figma.variables.getLocalVariablesAsync()
const tokens = Object.fromEntries(vars.map((v) => [
  v.name.replace(/\//g, "."),
  { $type: v.resolvedType.toLowerCase(), $value: v.valuesByMode[modeId] }
]))
figma.ui.postMessage({ type: "diff", tokens })

What I learned

Sync tools fail on trust, not on code. People only press the button when they can see exactly what it will change.

  • Show the diff first, always

  • Make the safe path the default one

A plugin earns its place the day nobody has to ask which file is right.

FRAME 10 — Contact

Have a project? Let’s shoot.

Tell me what you are making. I reply within a day with next steps and a rough plan.

Studio 1 · Rec

Studio 1 · Rec

Studio 1 · Rec

Prod.

Portfolio 2026

Scene

Footer

Take

1

Roll

A-09

Director

Mara Voss

Date

27.10.26

Build

main · 9f3c1a

That’s a wrap.

Thanks for watching to the end. Say hello, I read every message and reply within a day.

Write to me

© 2026 Mara Voss

Local time

09:00

· Berlin

Back to top

↑

Create a free website with Framer, the website builder loved by startups, designers and agencies.