Skip to content

useTheme

@astryxdesign/core v0.7.1 · useTheme

Returns ​

NameTypeDescription
nameComputedRef<string>Name of the nearest theme, or neutral when no Theme is present.
modeComputedRef<'light' | 'dark'>Resolved effective color mode. system is resolved to light or dark.
token(name: string) => stringResolve a single design token to its current CSS value for the effective mode. Outside a Theme, it reads the document's custom properties.
tokensComputedRef<Record<string, string>>Tokens declared by the nearest theme, resolved for the effective mode. A [light, dark] tuple becomes one value. Stable until the active theme or mode changes.

Token names may be written either way: --color-accent or --astryx-color-accent.