Files
EpicNext-Cms/src/lib/theme-settings.ts
T
openhands df38dccbf1
Local Build and Deploy / deploy (push) Failing after 46s
style: format code biome
2026-07-13 21:57:41 +02:00

19 lines
486 B
TypeScript

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],
),
);
}