import type { Theme } from "../api.js"; // Theme application. The whole UI reads colour through the --color-term-* tokens; // the light palette lives in index.css under `html.theme-light`. Applying a theme is // just toggling that class on . The active theme is the LOGGED-IN USER's stored // preference (users.theme), applied via applyTheme() after auth resolves — mirroring // how language works. Dark is the default before auth resolves. Printed tickets are // unaffected (always Albanian, dark-agnostic). /** Apply a theme by toggling `theme-light` on . Dark is the absence of the * class (the base tokens). No-op-safe to call repeatedly. */ export function applyTheme(theme: Theme): void { document.documentElement.classList.toggle("theme-light", theme === "light"); }