UX Hero

From Chaos to Tokens: Fixing Figma Architecture in 7 Days

A fintech startup we worked with had a Figma file with 400+ hardcoded hex color values. No token system. No semantic naming. Designers set colors manually. Developers copied hex codes. Every update was manual work.

In 7 days, we transformed it. One token system. Primitives, semantic, and component layers. Automated export to npm. Clean handoff to a codebase that actually uses the tokens. Here's exactly how we did it, and what the team got on day 7.

What "Chaotic Figma" Looks Like

Before we started, the symptoms were obvious:

The problem cascaded. Designers couldn't change colors easily. Developers had to ask "what's the right color?" Consistency eroded. Every new feature took longer.

Root cause: Figma variables didn't exist when the design system started. The file grew organically. By the time variables became available, no one had time to refactor. Classic technical debt.

Day 1-2: The Audit

We spent day 1 and 2 analyzing, not building.

Question 1: How many unique colors actually exist? Sounds simple. Answer: 47 unique hex values, but 200+ color components because they were copied and renamed.

Question 2: Which colors appear in which layers? We built a map. Light mode primary button background: #A8FF57. Dark mode: #2A3E5C. Same color used for text emphasis. Same color used for status badges.

Question 3: What's the naming logic? There wasn't one. "Button Blue" and "Action Primary" were the same color.

Question 4: What does the code expect? We checked the dev codebase. They had CSS variables for some colors but weren't using them consistently. Lots of hardcoded hex codes.

By end of day 2, we had a complete picture. Not a pretty one, but clear.

Day 3: Building the Primitive Layer

Start with primitives: the raw material. Every unique color, spacing value, and typography size that exists in the current Figma file. No abstraction. Just names and values.

We created these groups in Figma variables:

For spacing and typography, we worked backward from the code. The codebase had a Tailwind config already. We just mirrored it into Figma. For colors, we consolidated the 47 unique values into a rational color scale. Design system 101: 50-900 scale for grays, oranges, greens, etc.

By end of day 3, Figma had a complete primitive layer. Every design element was remapped to use a primitive variable.

Day 4: Semantic Tokens and Aliases

Primitives are the building blocks. Semantics are the meaning.

color-primitive-blue-600 is a primitive. color-semantic-primary is a semantic token. It aliases to the blue-600 primitive. This separation matters: designers and developers work with semantic names ("primary", "secondary", "error") while primitives stay stable underneath.

We created semantic tokens for:

Each semantic token has two modes: light and dark. When you switch modes in Figma, colors flip automatically.

For spacing and typography, we created semantic tokens too:

By end of day 4, the middle layer was complete. Figma now had a two-tier system: primitives (stable values) and semantics (meaning). Every component used semantic tokens.

Day 5: Component Tokens and Wiring

Component tokens go one level deeper: specific tokens for specific components. Button has its own tokens, distinct from a Card.

We created:

Why? Because now if a designer says "we need a new button variant," it's not 10 manual color picks. It's one new component token that aliases to semantic tokens. Changes cascade automatically.

We also wired everything up in Figma: every button instance now used component-level tokens instead of hardcoded colors. Every form input used input-specific tokens. Every type style used typography tokens.

By end of day 5, the three-tier system was complete: primitives → semantics → components. All wired together with aliases. One change at the top ripples down.

Key insight: The design team spent 3 hours validating aliases on day 5. They found 3 errors (a component token pointing to the wrong semantic). Those 3 errors, if missed, would have shipped into code and caused QA cycles. Catching them in Figma first saved them days later.

Day 6-7: QA, Documentation, Handoff

Day 6 morning: Export tokens to JSON. We set up a GitHub Action that reads the Figma token file, validates the schema (all semantics must reference primitives, all components must reference semantics), and publishes to npm.

Test export: 250 lines of clean JSON. Design team reviews. Changes one alias. Exports again. Works.

Day 6 afternoon: Wired it into the dev codebase. The CSS preprocessor now imports tokens from npm. A button using color-semantic-action-primary in Figma automatically gets the right hex code in the browser.

Push a test PR. Build succeeds. Visual regression test passes. Button colors match perfectly.

Day 7 morning: Documentation. We created a Storybook file (just markdown) that shows the token structure, explains each tier, gives examples, and documents the export process. Design team adds it to their wiki. Dev team bookmarks it.

Day 7 afternoon: Training call with the team. 30 minutes. "Here's a semantic token. Here's how you use it in Figma. Here's how it exports to code. Here's what to do when you need a new token."

Ship the final PR: redesigned Figma file + token JSON + documentation. Done.

What the Team Gets on Day 7

Specific deliverables the fintech team shipped with:

The team's immediate impact:

Three months after the sprint, that team shipped 8 new features. They credited the token system for 20% reduction in dev time—no more "what color should this be?" back-and-forth. Clean specification from day one.

Ready to rebuild your Figma?

A sprint covers token architecture, export automation, and code integration. You ship on day 7 with a working system your team can immediately use.

Start Your Sprint