Skip to content

ThemeVariant

ThemeVariant = "dark" | "light" | "custom"

Defined in: src/hooks/useTheme/useTheme.types.ts:36

Detected theme variant.

Detection is root-only: the hook reports 'light' only when the lightThemeClass produced by createLightTheme() is applied to document.documentElement — the same element the hook reads CSS variable values from. A light-themed subtree wrapped in VanillaThemeProvider does not flip this variant, because the resolved values would still come from the root.

  • 'dark' — the default; no lightThemeClass on :root.
  • 'light'lightThemeClass is on :root.
  • 'custom' — reserved. v0.8 does not auto-detect themes produced by createCustomTheme(selector, overrides); the union member exists so future releases can add detection without a breaking type change.