mirror of
https://github.com/Dvorinka/Dash.git
synced 2026-06-04 07:22:56 +00:00
9e7acc868d
Remove the "casaos" theme in favor of a unified design system. This involves cleaning up conditional styling across components, simplifying the theme toggle, and updating the global CSS variables to a more consistent dark/light mode implementation. - Remove `casaos` theme from `themes.ts` and `ThemeToggle` - Refactor `globals.css` to use a single dark mode definition - Simplify component styling by removing `isCasaOS` conditional logic - Update UI components (`Card`, `Badge`, `WidgetCard`, etc.) to use standard design tokens - Update E2E smoke tests to reflect theme changes
26 lines
685 B
TypeScript
26 lines
685 B
TypeScript
export type Theme = "light" | "dark";
|
|
|
|
const STORAGE_KEY = "dash-theme";
|
|
|
|
export function getStoredTheme(): Theme {
|
|
if (typeof window === "undefined") return "dark";
|
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
if (stored === "light" || stored === "dark") return stored;
|
|
return "dark";
|
|
}
|
|
|
|
export function setStoredTheme(theme: Theme) {
|
|
if (typeof window === "undefined") return;
|
|
localStorage.setItem(STORAGE_KEY, theme);
|
|
}
|
|
|
|
export function applyTheme(theme: Theme) {
|
|
if (typeof document === "undefined") return;
|
|
document.documentElement.setAttribute("data-theme", theme);
|
|
}
|
|
|
|
export const themeLabels: Record<Theme, string> = {
|
|
light: "Light",
|
|
dark: "Dark",
|
|
};
|