feat: persist complete multitheme palettes
This commit is contained in:
1 parent
3fd2a27719
commit
9cdd0b4000
4 files changed
+69
-21
No files matched your search
@@ -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]),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user