Language Preview—DTL is currently in alpha. Explore the language, try the playground, and learn how to use it.Alpha release coming soon.
Themes
Themes allow you to create variants of your design system by overriding token values. Perfect for dark mode, high contrast, or brand variations.
Basic Syntax
Themes are defined using the theme keyword and extend a base token set:
Theme Inheritance
Themes inherit all tokens from their base token set. You only need to override the tokens that should be different:
Nested Overrides
You can override nested tokens using dot notation:
Multiple Themes
You can create multiple themes from the same base:
Theme Composition
Themes can reference other tokens, including from the base set:
Use Cases
Dark Mode
High Contrast
Compact Spacing
Best Practices
- •Keep base tokens semantic:Use semantic names in your base token set
- •Override only what's needed:Don't duplicate tokens that don't change
- •Use consistent naming:Name themes clearly (Dark, Light, HighContrast, etc.)
- •Test accessibility:Ensure theme variants meet contrast requirements