useTheme
@astryxdesign/core v0.7.1 · useTheme
Returns
| Name | Type | Description |
|---|---|---|
name | ComputedRef<string> | Name of the nearest theme, or neutral when no Theme is present. |
mode | ComputedRef<'light' | 'dark'> | Resolved effective color mode. system is resolved to light or dark. |
token | (name: string) => string | Resolve a single design token to its current CSS value for the effective mode. Outside a Theme, it reads the document's custom properties. |
tokens | ComputedRef<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.