Generate Design Systems Programmatically
Write logic once. Generate entire color palettes, spacing scales, or typographic systems.
// Generate a 9-step color ramp from a brand color
variable brand: Color = #3B82F6;
variable brandHsl: Color.Hsl = brand.to.hsl();
variable ramp: List;
variable step: Number = 1;
variable stepValue: Number;
variable lightness: Number;
variable key: String;
while (step <= 9) [
stepValue = step * 100;
lightness = 95 - (step * 10);
key = "blue-".concat(stepValue.to_string());
ramp = ramp.append(hsl(brandHsl.h, brandHsl.s, lightness));
step = step + 1;
]
return ramp;
Change the brand color. The entire ramp regenerates automatically.
Everything You Need
From language basics to production deployment, we've got you covered.
Language Specification
Complete reference for syntax, types, control flow, and functions. Learn how the interpreter executes your token logic.
Learn more →Integration Guides
Embed the interpreter in your design system pipelines. Resolve token sets and automate transformations in CI/CD.
Learn more →Extensible Runtime
Register custom color spaces, units, and functions without forking. Ship product-specific extensions in pure JSON.
Learn more →Why TokenScript?
Built specifically for design token workflows with modern teams in mind.
Design-Native Language
- First-class colors, units, lists, dictionaries, and references
- Deterministic evaluation with strong typing
- Method chaining for elegant transformations
Production-Ready Tooling
- CLI commands for parsing, validation, and compliance
- Performance instrumentation and debugging
- Token set resolution with dependency graphs
Flexible Architecture
- Register custom functions and color spaces in JSON
- Clone and compose interpreter configurations
- Safely embed in any JavaScript environment
Ready to Get Started?
Explore our quickstart guide and start automating your design token workflows in 5 minutes.
Get Started Now