Holds one half of the theme, the style or the color scheme, for ThemeProvider, which uses it once for each. Both halves work alike: the account's choice wins, then this browser's, then a fallback; the result is applied to the root element and mirrored to localStorage, where index.html's first-paint script reads it.

Functions

f
useThemeChoice<T extends string>(spec: ThemeChoiceSpec<T>): UseThemeChoiceResult<T>

Returns the half of the theme spec describes. An unknown stored value, such as "default", which "smooth" was once stored as, reads as no choice.

Interfaces

I
ThemeChoiceSpec

Passed to useThemeChoice by ThemeProvider, as a constant: one for the style, one for the scheme.

I
UseThemeChoiceResult

Returned by useThemeChoice to ThemeProvider.