feat(projects): support loading page dark mode adaptation. (#702)

This commit is contained in:
青菜白玉汤
2025-01-26 22:32:05 +08:00
committed by GitHub
parent 86da767e24
commit 9b9455d945
5 changed files with 15 additions and 5 deletions

View File

@ -174,6 +174,7 @@ export const useThemeStore = defineStore(SetupStoreId.Theme, () => {
darkMode,
val => {
toggleCssDarkMode(val);
localStg.set('darkMode', val);
},
{ immediate: true }
);

View File

@ -5,8 +5,7 @@ import { overrideThemeSettings, themeSettings } from '@/theme/settings';
import { themeVars } from '@/theme/vars';
import { toggleHtmlClass } from '@/utils/common';
import { localStg } from '@/utils/storage';
const DARK_CLASS = 'dark';
import { DARK_CLASS } from '@/constants/app';
/** Init theme settings */
export function initThemeSettings() {