Tokens Bundles

Tokens are a type of bundle, just like components, events, and interfaces.

Salesforce recommends that you use Styling Hooks instead of design tokens if possible. While existing design tokens still work, styling hooks are the future of customization for Lightning web components and Aura components. See Replace Design Tokens with Styling Hooks.

Important

A tokens bundle contains only one resource, a tokens collection definition.
Resource Resource Name Usage
Tokens Collection defaultTokens.tokens The only required resource in a tokens bundle. Contains markup for one or more tokens. Each tokens bundle contains only one tokens resource.

You can’t edit the tokens bundle name or description in the Developer Console after you create it. The bundle’s AuraBundleDefinition can be modified using the Metadata API.

Note

A tokens collection starts with the <aura:tokens> tag. It can only contain <aura:token> tags to define tokens.

Tokens collections have restricted support for expressions; see Using Expressions in Tokens. You can’t use other markup, renderers, controllers, or anything else in a tokens collection.