Book a callGitHub224

Guides06/14

Export to code and design tools

Updated · Suggest a change

OpenDesigner exports your design system to code and design tools: CSS variables, a Tailwind v4 theme, Swift, Jetpack Compose, Figma variables, Paper tokens, a DTCG resolver, a Claude Design System artifact and a brand and press page. One engine.py build writes the ones your platforms need from the DTCG token files, which stay the source of truth. The opendesigner-export skill can also write the system straight into Figma or Paper when their MCP servers are connected.

One rule: change the decision, then rebuild

Every export is made from the files in opendesigner/tokens/. Don't edit an export by hand, because the next build overwrites it. Change the decision instead, then rebuild.

Edit an export by hand

The change lives in one file. The next build overwrites it, and Swift, Compose and Figma never saw it.

build/css/tokens.css
/* ... do not edit by hand. */
--ds-radius-container: 12px 16px;
css
16px until rebuilt
swift
12px
compose
12px
figma
12px

Change the decision, then rebuild

One command records the reason, and one build rewrites every export together.

$ engine.py set dials.roundness 60 --why "softer corners for a friendlier feel"
$ engine.py build
csstailwindswiftcomposefigmapaperdtcgDESIGN.md
Every export is made from the token files, so a hand edit to one of them lasts until the next build and never reaches the others. Changing the decision and rebuilding updates all of them at once, with the reason on record.

build generates the tokens and checks them. If there are no errors, it writes the exports, DESIGN.md, the overview page and the preview pages. Code exports follow the platforms you chose, and the build names what it left out. Figma, Paper, DTCG, the artifact files and the brand page are always written, and a code file already in build/ is refreshed by every build.

For developers

Change a decision and rebuild:

engine.py set dials.roundness 60 --set-by chosen --quote "a bit friendlier" --why "softer corners for a friendlier feel"
engine.py build

Write one format, or all of them:

engine.py export --format tailwind

The formats are css, tailwind, figma, paper, swift, compose, dtcg, artifact, brand and all. shadcn is written only when you ask for it, and every build after that keeps it up to date.

Code exports

Source of truth
opendesigner/tokens/
DTCG 2025.10 sets and opendesigner.resolver.json for the modes: light and dark, three densities, standard and reduced motion
engine.py build
CSS
build/css/tokens.css
Custom properties, --ds-...
Tailwind v4
build/tailwind/theme.css
A @theme that imports tokens.css
Swift
build/swift/DesignTokens.swift
SwiftUI values under DS
Jetpack Compose
build/compose/DesignTokens.kt
Light and dark color sets, spacing, type, motion
Figma
build/figma/import/
One file per collection and mode, plus variables.json
Paper
build/paper/
Tokens with the dark values as a separate set
DTCG resolver
build/dtcg/
One entry point for token tools
Claude artifact
build/artifact/project/
Tokens, a brand book, a cover and a button preview
Brand page
build/brand/index.html
Logo rules, colours, type and icons, with your files to download
One source, many exports. The DTCG token files are the only thing anyone edits, through decisions; every export is written from them, so they can never disagree. A build writes the ones your platforms need.
ExportFile, inside opendesigner/How to use it
Tokenstokens/, with opendesigner.resolver.json for the modesWith token tools
DTCG resolverbuild/dtcg/With tools that take a single entry point
CSSbuild/css/tokens.cssImport it once at the root of your app. Light and dark, densities and reduced motion included
Tailwind v4build/tailwind/theme.cssAdd one line after Tailwind in your main CSS file. It imports tokens.css itself
shadcn/uibuild/shadcn/globals.cssRun engine.py export --format shadcn once. In the CSS file that components.json names, replace the :root, .dark and @theme inline blocks from shadcn init with one import of this file. shadcn components then use your colours and radii, in light and dark
Swiftbuild/swift/DesignTokens.swiftAdd it to your iOS target. Text uses Dynamic Type
Jetpack Composebuild/compose/DesignTokens.ktAdd it to your Android UI module
Claude Design System artifactbuild/artifact/project/The system as an artifact in Claude: tokens, a brand book, a cover and a button preview

Each code export, where it lands and how to use it.

The wiring for each one is on For engineers. If your brand font's licence doesn't cover apps, the Swift and Compose files use the system font instead and say so. Check this before you ship an app build.

Brand and press page

build/brand/index.html is a page about your brand that you can host as it is, made from your tokens, in light and dark. It shows:

  • your logo files with download links, the clear space and smallest size, and do and don't examples made from your own logo;
  • every colour role with its hex, RGB and OKLCH values, and what it is for;
  • each font with its weights, its jobs and a licence note;
  • the icon grid and its rules, your icon files, and the open icon set you chose, with its licence.

Your short description, facts, leadership, figures and press contact say "Not enough information" until you give them. Nothing on the page is made up. Font files are never included: an open-licence font loads from Google Fonts, and any other font shows only on computers that have it installed. See Brand assets for the logo rules.

Figma

What the skill can do depends on what is connected, and it checks before it promises anything.

With Figma's remote MCP server (you're signed in, with a Full seat; writing to the canvas this way is still in beta), the skill:

  1. confirms the target file with you, and suggests working on a duplicate first;
  2. creates five variable collections: Primitives, Color (Light and Dark), Density (Spacious, Comfortable and Compact), Motion (Standard and Reduced), and Tokens for values that don't change by mode;
  3. scopes each variable and sets its code syntax to the CSS variable name, so developers see var(--ds-...);
  4. adds text styles for the type scale and effect styles for the shadow levels;
  5. builds specimen frames and a component sheet, bound to the variables;
  6. reads the variables back and reports any mismatch with the tokens.

If a collection has more modes than your Figma plan allows, the engine splits it and warns you. When someone edits in Figma, the skill reads the changes back and records each one as a decision, never editing the token files directly.

With Figma's desktop MCP server only, it can read a file but not write to it, so it compares the file with your tokens.

With nothing connected, use the files in build/figma/import/, one per collection and mode, with Figma's variables import, or build/figma/variables.json with Tokens Studio. Figma's import takes one mode per file, sRGB colors, px units and no composite tokens.

build/figma/import/ · one file per collection and mode
Primitives
Primitives.Value.tokens.json
284 variables
Color
Color.Light.tokens.jsonColor.Dark.tokens.json
86 variables
Density
Density.Spacious.tokens.jsonDensity.Comfortable.tokens.jsonDensity.Compact.tokens.json
19 variables
Motion
Motion.Standard.tokens.jsonMotion.Reduced.tokens.json
10 variables
Tokens
Tokens.Value.tokens.jsoneverything that doesn't change by mode
68 variables
one mode per filesRGB colorspx unitsno composite tokenswhat Figma's import accepts
The nine Figma import files for OpenDesigner's own brand: five collections, with a file for each mode because Figma's variables import takes one mode per file. Variable counts are from the brand's own build.

Hands-on Figma research is still an open task, so these steps rest on Figma's own docs.

Paper

Paper's MCP server runs inside Paper Desktop on your computer. While it runs, the skill:

  1. reads Paper's guide and looks at the file;
  2. writes your tokens. Paper tokens have no modes, so the dark values go in a separate, clearly named set;
  3. checks the fonts, then draws specimen artboards and a component sheet with your values;
  4. checks each artboard with a screenshot and fixes clipping.

Comments and selections in Paper come back as decisions, the same way Figma edits do.

Before you hand it over

  • engine.py validate passes, or each warning has a written reason.
  • Each export is explained in one plain sentence, with its path.
  • Everyone knows the source is opendesigner/tokens/, and nobody edits exports by hand.

The skill asks before wiring an export into your code, such as your main CSS file or build config.

What is early

  • No direct React Native or Flutter export yet.
  • The Figma and Paper writes depend on those tools' MCP servers, and no test pass in each tool is recorded yet.
  • If an export is wrong or missing, record it with engine.py feedback. It prints a GitHub link you can file, and nothing is posted unless you submit it.