Skip to content
ChromaBrew
Go Pro
TutorialsBy Opeyemi Olorunfemi

Hand off design tokens developers will actually use

A worked tutorial: export semantic tokens as CSS and JSON, document the roles, and set up a handoff no one has to guess at.

Export both formats from one source

Generate the token set once and export CSS variables for the stylesheet plus JSON for the design pipeline — same values, two shapes, zero re-typing. The CSS carries the runtime (colors, shadows, radii the browser reads); the JSON carries the system of record designers and tooling diff against.

Keep tiers separated: primitive values (the raw scale), semantic roles (background, primary, danger), and component assignments (button-fill). Developers consume the top tier; the lower tiers exist so a rebrand touches primitives, not fifty components.

Document roles, not values

A token file without docs is a riddle: is surface-sunken darker or lighter than surface? Write one line per semantic token — where it goes, what sits on it, its contrast guarantee. The five minutes per token pays back every time someone new touches the UI.

Include the contrast contract explicitly: which pairs are guaranteed (text-primary on background) and which are not (accent on accent). Developers make correct choices from contracts, not from hex literacy.

Make the handoff a pipeline, not a file drop

A tokens file emailed once rots within a quarter. Commit the JSON to the repo both sides share, version it, and review token diffs like code — a changed primitive with fifty dependents deserves the same scrutiny as a changed API. Changelogs for color sound excessive until the first silent regression.

For Tailwind stacks, emit the theme block from the same source so utilities and tokens cannot disagree. Two sources of color truth is zero sources.

Tip

Run a quarterly token audit: grep for raw hex/rgb values in component code. Every hit is a token that is missing or undiscoverable — fix the system, not just the instance.

Related free tools

Want to apply this right now? Open the color palette generator and try it with your own brand color — free, no sign-up.