API and Development
data-theme attribute on the document element. Light token values are declared on :where(:root). Dark token values are declared under [data-theme='dark']. There is no ThemeProvider and no brand class on the document.
createAppearancePreference from @prepared911/ui applies AppearanceMode.Light, AppearanceMode.Dark, or AppearanceMode.System. The first application does not animate. Later changes go through transitionAppearance. Persisting the choice is the caller's job.
preference.mode is the last mode passed to set, or the initial mode. dispose() stops following the system setting.
A region that must stay on one appearance uses themeRegionProps(ThemeRegionAppearance.Light) or ThemeRegionAppearance.Dark from @prepared911/ui. That region does not restyle popups portaled outside it.
Import @prepared911/ui/tokens.css once so the custom properties exist. Import @prepared911/ui/appearance-transition.css after it when the animated appearance change should use the design system's rise, rather than the browser's default cross-fade.