Skip to main content
The StyleX export is a zip containing two generated TypeScript modules:
  • tokens.stylex.ts defines the default token values with stylex.defineVars.
  • themes.ts exports lightTheme and darkTheme with stylex.createTheme.
Install and configure StyleX in the consuming project first:

Output

Use the generated variables in stylex.create, then apply a theme to an element that contains the themed subtree:
Humic generates stable camelCase keys because StyleX variables are imported JavaScript properties rather than public CSS custom-property names. The CSS prefix and naming-convention settings therefore do not apply to this format. Typography and other composite tokens that need several CSS properties are expanded into separate variables such as typographyBodyFontSize and typographyBodyLineHeight.

API

Download the zip from the published version: