gui/theme/applyTheme

The pure side-effect layer for theming: resolve a mode to a concrete base and write it to <html data-theme>. Kept dependency-free (no React) so it can run from the provider, from tests, and — in spirit — mirrors the inline boot script in index.html.

Description:
  • The pure side-effect layer for theming: resolve a mode to a concrete base and write it to <html data-theme>. Kept dependency-free (no React) so it can run from the provider, from tests, and — in spirit — mirrors the inline boot script in index.html.

Source:

Methods

(static) applyAccent()

Description:
  • Apply the accent to <html data-accent>. The id is trusted (the caller — the ThemeProvider — validates against built-in ∪ user-theme ids first, since user themes are valid too). Returns the applied id. No-op without a document.

Source:

(static) applyTheme()

Description:
  • Apply the theme to <html> by setting data-theme to the resolved base. Returns the resolved base so callers can track it. No-op without a document.

Source:

(static) prefersLight()

Description:
  • True when the OS currently prefers a light color scheme.

Source:

(static) resolveMode()

Description:
  • Resolve a mode (system | dark | light) to a concrete base (dark | light). system follows the OS via prefersLight().

Source: