Reset Theme
The stylex.defineVars
function is used to create a set of CSS variables,
called VarGroup
s. Further, the stylex.createTheme
function can be used to create
Theme
s, that override the values of the variables defined within VarGroup
s.
Theme
s in StyleX are mutually exclusive and do not merge. Any variable that is not
explicitly overridden in a Theme
is set to its default value.
This characteristic of Theme
s can be used to define a "empty" theme that resets all variables
to their default values.
Example
import * as stylex from '@stylexjs/stylex';
import { vars } from './variables.stylex';
export const resetVars = stylex.createTheme(vars, {});