fix: dark theme as array

This commit is contained in:
Eli Bosley
2024-12-17 09:39:46 -05:00
parent 116efe6f72
commit 77558a5cd9

View File

@@ -72,7 +72,10 @@ export const defaultColors: Record<string, ThemeVariables> = {
'--header-text-secondary': '#999999',
'--header-background-color': '#1c1b1b',
},
};
} as const;
export const DARK_THEMES = ['black', 'azure'] as const;
export const useThemeStore = defineStore('theme', () => {
// State
@@ -81,7 +84,7 @@ export const useThemeStore = defineStore('theme', () => {
const activeColorVariables = ref<ThemeVariables>(defaultColors.light);
// Getters
const darkMode = computed(
() => (theme.value?.name === 'black' || theme.value?.name === 'azure') ?? false
() => DARK_THEMES.includes(theme.value?.name as (typeof DARK_THEMES)[number]) ?? false
);
// used to swap the UPC text color when using the azure or gray theme
const bannerGradient = computed(() => {