defineVars
defineVars<
T>(tokens):object
Defined in: uzumaki.d.ts:618
Build a theme ref object from a map of tokens.
Returns { vars, theme }. Pass vars to a window’s vars option (or
window.setVars(...)); use theme.token anywhere a style prop value is
expected. Values that start with $ are looked up from the window’s
theme at paint time.
Type Parameters
Section titled “Type Parameters”T extends Record<string, string>
Parameters
Section titled “Parameters”tokens
Section titled “tokens”T
Returns
Section titled “Returns”object
theme: { [K in string | number | symbol]: string }
vars:
T
Example
Section titled “Example”const { vars, theme } = defineVars({ bg: '#0a0a0a', text: '#e4e4e7' });new Window('main', { vars, rootStyles: { bg: theme.bg, color: theme.text } });