feat: persist complete multitheme palettes

This commit is contained in:
Simo committed 2026-07-12 14:49:36 +02:00
1 parent 3fd2a27719
commit 9cdd0b4000
4 files changed
+69 -21

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import { THEME_COLOR_KEYS, type ThemeColorKey, type ThemeMode, type ThemePreset } from "@/lib/theme-presets";
export function settingKey(key: ThemeColorKey, mode: ThemeMode): string {
return mode === "light" ? key : `${key}_dark`;
}
export function presetSettings(preset: ThemePreset): Array<[string, string]> {
return (["light", "dark"] as const).flatMap((mode) =>
THEME_COLOR_KEYS.map((key) => [settingKey(key, mode), preset[mode][key]] as [string, string]),
);
}