refactor: color picker

This commit is contained in:
zhom
2025-08-15 00:54:57 +04:00
parent a6af568d9e
commit 88cb154fca
4 changed files with 93 additions and 43 deletions
+1 -10
View File
@@ -29,16 +29,7 @@ export function CustomThemeProvider({ children }: CustomThemeProviderProps) {
const { invoke } = await import("@tauri-apps/api/core");
const settings = await invoke<AppSettings>("get_app_settings");
const themeValue = settings?.theme ?? "system";
if (themeValue === "custom") {
setDefaultTheme("light");
const vars = settings.custom_theme ?? {};
try {
const root = document.documentElement;
Object.entries(vars).forEach(([k, v]) => {
root.style.setProperty(k, v);
});
} catch {}
} else if (
if (
themeValue === "light" ||
themeValue === "dark" ||
themeValue === "system"