Sets application theme mode and updates DOM and storage.
The theme mode to set ("dark", "light", or "system").
True if dark mode is enabled, false otherwise.
Dispatches "themeToggled" event on document.
export async function setTheme(newTheme: ThemeMode) { // Delegate to the explicit mode methods for clarity and single-responsibility switch (newTheme) { case "dark": return enableDarkMode(); case "light": return enableLightMode(); case "system": default: return applySystemTheme(); }} Copy
export async function setTheme(newTheme: ThemeMode) { // Delegate to the explicit mode methods for clarity and single-responsibility switch (newTheme) { case "dark": return enableDarkMode(); case "light": return enableLightMode(); case "system": default: return applySystemTheme(); }}
Sets application theme mode and updates DOM and storage.