Language PreviewDTL is currently in alpha. Explore the language, try the playground, and learn how to use it.Alpha release coming soon.

Token Sets

Token sets are the top-level containers for organizing your design tokens. They group related tokens together and provide a namespace for your design system.

Basic Syntax

Token sets are defined using the tokens keyword (or token-set for backward compatibility):

Naming

Token set names should be descriptive and follow PascalCase convention. They act as namespaces, so choose names that clearly identify the purpose.

Nested Structure

Token sets can contain groups and individual tokens. Groups help organize related tokens hierarchically.

Multiple Token Sets

You can define multiple token sets in a single file. This is useful for organizing large design systems.

Referencing Token Sets

To reference tokens from other token sets, use dot notation:

Best Practices

  • Use descriptive names:Token set names should clearly indicate their purpose
  • Keep related tokens together:Group tokens by their purpose or domain
  • Use Foundation/Components pattern:Separate base tokens from component-specific tokens
  • Avoid deep nesting:Keep your hierarchy shallow for better readability