- Migrate to packages/web + packages/desktop workspace layout via git mv - Add Tauri v2 desktop shell with @tauri-apps/plugin-http for CORS bypass - Configure Turborepo with package-level dependsOn build graph - Add semantic-release with exec plugin for GHA output and disabled PR comments - Fix http:default capability scope to allow all HTTP/HTTPS origins - Add Vite Tauri integration (clearScreen, TAURI_DEV_HOST, target, envPrefix) - Add semantic-release.yml and release.yml GitHub Actions workflows - Fix all Biome lint errors (noArrayIndexKey, noNonNullAssertion, button types)
15 lines
488 B
TypeScript
15 lines
488 B
TypeScript
const THEME_KEY = "openconcho:theme";
|
|
|
|
export type Theme = "dark" | "light";
|
|
|
|
export function getStoredTheme(): Theme {
|
|
const stored = localStorage.getItem(THEME_KEY) as Theme | null;
|
|
if (stored === "dark" || stored === "light") return stored;
|
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
}
|
|
|
|
export function applyTheme(theme: Theme): void {
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
localStorage.setItem(THEME_KEY, theme);
|
|
}
|