Design Tokens Transformer
On TrackSproutPublicFeatured
Style DictionaryOverview
Design Tokens Transformer is a utility that takes design token JSON files and converts them into platform-specific outputs such as:
- CSS / SCSS variables
- Tailwind configuration
- JavaScript / TypeScript modules
- iOS (Swift)
- Android (XML)
The goal is to allow teams to define design decisions once and generate consistent outputs for multiple platforms from the same source of truth.
Problem It Solves
Design tokens often start as structured JSON, but each platform needs them in different formats:
- Web needs CSS or Tailwind configs
- Native apps need strongly typed values
- Design systems need predictable naming
- Developers need automation, not manual mapping
Without a transformer:
- Tokens drift between platforms
- Changes require repetitive manual work
- Validation and previewing are difficult
This project removes that friction.
What It Does
- Reads token JSON files
- Normalizes token structure
- Applies transformation rules per platform
- Outputs consumable artifacts
- Supports live preview of results
Example outputs:
tokens.csstokens.scsstailwind.config.jstokens.tsColors.swiftcolors.xml
Architecture
High-level flow:
- Input Design tokens defined in JSON
- Transform Rules convert tokens into platform formats
- Output Generated files per platform
- Preview Web UI shows rendered results
Tech Stack
- Node.js
- TypeScript
- Style Dictionary (core transformer)
- Tailwind CSS (output target)
- Simple web UI for preview
Status
Sprout 🌱
The core transformer works, but the project is still evolving:
- Token schema may change
- Output formats are being refined
- UI is functional but not polished
Intended Users
- Design system teams
- Frontend engineers
- Mobile engineers
- Token authors
- Tooling / platform engineers
Design Principles
- Single source of truth
- Platform-agnostic inputs
- Predictable outputs
- Automation over duplication
- Human-readable artifacts
Example Use Cases
- Generate Tailwind tokens from Figma tokens
- Sync web and mobile colors
- Produce theme files for multiple brands
- Validate token naming and structure
- Preview token changes before release
Future Enhancements
- Schema validation
- Plugin-based output targets
- Theming support
- Token diffing
- Versioned exports
- CI integration
Related Notes
- design-tokens
- design-systems
- style-dictionary
- tailwind
- automation
Why This Lives in the Digital Garden
This project is:
- A long-term tool
- A learning sandbox
- A design systems reference
- A reusable internal utility
It will likely evolve over time rather than “finish” once.
Screenshots
Next Actions
- Add Tailwind config output support
- Add token validation and error reporting
- Improve live preview UI
- Document usage with examples