Overview
globalTheme({ light, dark, … }) injects CSS custom properties for each theme: base on :root, explicit [data-theme] rules, and an OS dark media query when a second theme is present.
It returns { cssVars } — map token keys to "--name" strings. Switch themes with useUtils().themeAtom (see theme / title).
rootCSS({ … }) writes a flat map of tokens or plain CSS properties onto :root via the same global sheet as globalCSS.
Theme vs root tokens
|
API
|
What it sets
|
Notes
|
|---|---|---|
globalTheme
| Per-theme vars | light/dark + data-theme + auto media |
rootCSS
| :root only | One-shot token / property overrides |
themeAtom
| Runtime switch | From useUtils() — not returned by globalTheme |
globalTheme + themeAtom
cssVars drive inline styles; themeAtom toggles light / dark / auto.
rootCSS tokens
Inject custom properties on :root for local use.