API reference
defineTokens
API reference for the `defineTokens` method
defineTokens
is a method for defining CSS variables for each theme.
Usage
Import
Define Tokens
Define the tokens using css.defineTokens
.
This will generate the following CSS
Using Themes
To use themes, you need to add the data-theme
attribute to the root element.
Media Queries
defineTokens
can also be used with media queries.
This will generate the following CSS
Good to know
defineTokens
is not compiled until the variable is used.