Skip to main content

Interface: BundleCssVarsOptions

Defined in: roots/toCssVars.ts:437

Options for bundleToCssVars().

Properties

systemModeFallback?

optional systemModeFallback?: boolean

Defined in: roots/toCssVars.ts:456

Emit the @media (prefers-color-scheme) fallback block so the OS preference applies before JS runs (and without JS). Only meaningful for themeId-less bundles. Default true.

Set false when the app is deliberately single-default (defaultMode 'light' or 'dark' with the alternate reachable only via explicit toggle) — otherwise dark-OS users would get the alternate on first paint against the app's configured default. <ThemeProvider> / <ThemeHead> derive this automatically from their defaultMode prop.


themeId?

optional themeId?: string

Defined in: roots/toCssVars.ts:444

Theme identifier for scoping. Generates [data-tt-theme="<themeId>"] selectors. When omitted, CSS targets :root (canonical 1-theme model). The alternate mode selector becomes :root[data-tt-mode="dark"]. Use themeId only for multi-theme scenarios (Storybook, micro-frontends).