DESIGN.md vs Style Dictionary
Style Dictionary is a multi-platform build compiler that transforms token JSON files into CSS, Swift, Kotlin, and XML artifacts; DESIGN.md is a single-file visual specification written for both humans and AI coding agents. Style Dictionary is a build-time transformer, whereas DESIGN.md is the readable spec (tokens plus design judgment) that can either export directly to web CSS or sit alongside a Style Dictionary pipeline.
Side-by-side comparison
| Dimension | DESIGN.md | Style Dictionary |
|---|---|---|
| Category | Visual design specification format + lightweight web exporters | Configurable multi-platform token build engine (Node.js CLI / library) |
| Inputs | One DESIGN.md file (YAML frontmatter + Markdown prose) | Directories of JSON / DTCG token files + JS/ESM config (config.js) |
| Outputs | Tailwind v4 @theme, CSS variables, shadcn/ui themes, IDE rules (.mdc), AI prompts | Any custom target: CSS, SCSS, JS/TS, iOS Swift/Obj-C, Android XML/Compose, Flutter |
| Design rationale & Do’s/Don’ts | Built into the file (Overview, Layout, Components, Do's and Don'ts) | Not part of Style Dictionary — it transforms values only |
| Setup overhead | Minimal: one file at repo root, zero build config required | Moderate: requires Node config, transform groups, filters, and custom formats |
| WCAG contrast checks | Built into npx designmdpro lint and the browser Validator | Not built in (requires custom transforms or external lint scripts) |
| AI agent utility | Purpose-built for LLM context windows, MCP, and agentic UI generation | Raw source JSON and compiled outputs lack component recipes and negative constraints |
What Style Dictionary owns
Style Dictionary shines when an organization must compile one token tree into many platform-specific packages:
- Cross-platform native targets: generate Swift
UIColorextensions for iOS, XML resources or Jetpack Compose constants for Android, SCSS maps for legacy web apps, and CSS custom properties for modern web apps from one build step. - Custom transforms and filters: convert
pxtoremordp, transform color formats (oklch,hsl,rgba), split public vs internal tokens, and publish versioned npm / CocoaPods / Maven packages. - W3C DTCG support: Style Dictionary v4 natively parses DTCG
$value/$typefiles, making it the standard engine downstream of Figma token sync.
What DESIGN.md owns
DESIGN.md solves the problem Style Dictionary was never designed for: giving AI coding agents and web developers a concise, unambiguous visual specification without build-pipeline overhead:
- Zero-config web workflow: drop
DESIGN.mdat the root of a Next.js, React, or Vite repo, validate it withnpx designmdpro lint, and export Tailwind v4@themeor CSS variables in one command. - Intent alongside values: Style Dictionary outputs
--color-primary: #5645d4;, whileDESIGN.mdalso tells the agent when to use#5645d4, how surfaces layer, what border radii pair with cards vs buttons, and what visual patterns to avoid. - Portable across AI tools: works identically in Claude Code, Cursor, v0, and Google Stitch, or via the DesignMD Pro MCP server.
How they work together
In a multi-platform organization (Web + iOS + Android), you do not need to pick only one:
- Multi-platform build layer (DTCG + Style Dictionary): maintain your full cross-platform token set in DTCG JSON and let Style Dictionary publish native iOS/Android packages and web CSS variables.
- AI-ready visual contract (
DESIGN.md): keep aDESIGN.mdat the web repo root (or design-system repo root) that mirrors the semantic web tokens and documents layout rules, component recipes, and Do’s and Don’ts for AI coding agents. - CI alignment: run
npx designmdpro lintandnpx designmdpro diffon pull requests whenever tokens update soDESIGN.mdstays synchronized with your released Style Dictionary outputs.
For web-only projects, you can skip Style Dictionary entirely and use DESIGN.md with DesignMD Pro’s built-in Tailwind v4, CSS Variables, and shadcn/ui exporters.
When to use which
- Use
DESIGN.mdalone for web apps (Next.js, React, Vue, Tailwind, shadcn/ui) and AI-assisted development where you want fast setup, contrast linting, and direct CSS/Tailwind exports without maintaining a token compiler. - Use Style Dictionary when you ship native mobile apps (iOS Swift, Android Compose/XML) or multiple web stacks that require custom token transforms and published packages.
- Use both when you have a multi-platform Style Dictionary pipeline and engineering teams using Cursor, Claude Code, or v0 who need an AI-readable design specification.
Common mistakes
- Setting up Style Dictionary for a single Tailwind web app: maintaining custom transforms and build scripts adds complexity when
DESIGN.mdcan export@themeCSS directly. - Pointing AI coding agents at compiled Style Dictionary output files: generated
tokens.cssortokens.tsfiles contain flat variables with zero layout or component usage guidance. - Treating
DESIGN.mdas a native mobile compiler:DESIGN.mdtargets web CSS/Tailwind/shadcn and AI agents; keep Style Dictionary if you need Swift, Kotlin, or Android XML artifacts.
Frequently Asked Questions
Does DESIGN.md replace Style Dictionary?
Only for web-only teams that do not need custom multi-platform build transforms. If you compile tokens to iOS Swift, Android XML/Compose, or custom SCSS/JS packages, keep Style Dictionary for the build pipeline and use DESIGN.md as the AI-readable visual specification.
Can Style Dictionary read a DESIGN.md file directly?
Not out of the box, because Style Dictionary expects JSON or JS token modules (such as W3C DTCG tokens.json) rather than YAML frontmatter inside Markdown. Teams that use both keep DTCG JSON as Style Dictionary’s input and sync semantic values into DESIGN.md (or write a small custom parser).
Why would a team using Style Dictionary still add DESIGN.md?
Style Dictionary compiles token values, not visual judgment. Adding DESIGN.md gives AI coding agents (Claude Code, Cursor, Codex, v0) the surface hierarchy, typography pairing rules, component recipes, and Do’s and Don’ts needed to apply those compiled tokens accurately.
Does DesignMD Pro have a CLI for exporting tokens without Style Dictionary?
Yes. The designmdpro CLI (npx designmdpro) validates DESIGN.md files, diffs revisions, wires IDE rules, and exports Tailwind v4, CSS variables, and shadcn/ui themes directly. See the CLI Reference.
How do DTCG, Style Dictionary, and DESIGN.md fit together?
W3C DTCG (tokens.json) is the JSON interchange format, Style Dictionary is the multi-platform compiler that reads DTCG JSON and emits platform code, and DESIGN.md is the compact Markdown + YAML specification tailored for human review and AI coding agents.
Next steps
- DESIGN.md vs DTCG (tokens.json) — compare
DESIGN.mdwith the W3C token interchange format. - DESIGN.md vs Tailwind Config — export
DESIGN.mddirectly to Tailwind CSS v4@themewithout a separate build pipeline. - CLI Reference — lint, diff, and export
DESIGN.mdfrom the command line. - Tailwind CSS & shadcn/ui Integration — built-in web stylesheet exporters.