|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import { setCssVar } from './util' |
|
|
|
|
import { colorIsDark, darken, lighten } from '@/utils/color' |
|
|
|
|
import { useAppStore } from '@/store/modules/app' |
|
|
|
|
import { useAppStoreWithOut } from '@/store/modules/app' |
|
|
|
|
import { ThemeEnum } from '@/enums/appEnum' |
|
|
|
|
|
|
|
|
|
const HEADER_BG_COLOR_VAR = '--header-bg-color' |
|
|
|
@ -16,7 +16,7 @@ const SIDER_LIGHTEN_BG_COLOR = '--sider-dark-lighten-bg-color'
|
|
|
|
|
* @param color |
|
|
|
|
*/ |
|
|
|
|
export function updateHeaderBgColor(color?: string) { |
|
|
|
|
const appStore = useAppStore() |
|
|
|
|
const appStore = useAppStoreWithOut() |
|
|
|
|
const darkMode = appStore.getDarkMode === ThemeEnum.DARK |
|
|
|
|
if (!color) { |
|
|
|
|
if (darkMode) |
|
|
|
@ -47,7 +47,7 @@ export function updateHeaderBgColor(color?: string) {
|
|
|
|
|
* @param color bg color |
|
|
|
|
*/ |
|
|
|
|
export function updateSidebarBgColor(color?: string) { |
|
|
|
|
const appStore = useAppStore() |
|
|
|
|
const appStore = useAppStoreWithOut() |
|
|
|
|
|
|
|
|
|
// if (!isHexColor(color)) return;
|
|
|
|
|
const darkMode = appStore.getDarkMode === ThemeEnum.DARK |
|
|
|
|