Skua.Components.Theme (Skua v0.1.0)

Copy Markdown View Source

A dark/light theme toggle.

<.theme_toggle />

The SkuaTheme hook flips data-theme on <html> between dark and light, persists the choice to localStorage, and applies it on mount. Skua ships dark-first; the light token set lives in assets/css/skua.css under :root[data-theme="light"], so toggling re-skins every component with no per-component work.

To avoid a flash of the wrong theme on first paint, the installer also adds a tiny pre-paint script to the root layout; without it the toggle still works, it just settles a frame after load.

Summary

Functions

theme_toggle(assigns)

Attributes

  • class (:any) - Defaults to nil.
  • Global attributes are accepted.