Skip to content

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.

T extends Record<string, string>

T

object

theme: { [K in string | number | symbol]: string }

vars: T

const { vars, theme } = defineVars({ bg: '#0a0a0a', text: '#e4e4e7' });
new Window('main', { vars, rootStyles: { bg: theme.bg, color: theme.text } });