mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-08-28 21:50:46 +02:00
refactor: color picker
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user