diff --git a/internal/vite-config/src/utils/modifyVars.ts b/internal/vite-config/src/utils/modifyVars.ts index 1d00b7da325..0554343cb05 100644 --- a/internal/vite-config/src/utils/modifyVars.ts +++ b/internal/vite-config/src/utils/modifyVars.ts @@ -7,7 +7,6 @@ import { theme } from 'ant-design-vue/lib'; import convertLegacyToken from 'ant-design-vue/lib/theme/convertLegacyToken'; const { defaultAlgorithm, defaultSeed } = theme; - const primaryColor = '#0960bd'; function generateAntColors(color: string, theme: 'default' | 'dark' = 'default') { @@ -22,17 +21,14 @@ function generateAntColors(color: string, theme: 'default' | 'dark' = 'default') export function generateModifyVars() { const palettes = generateAntColors(primaryColor); const primary = palettes[5]; - const primaryColorObj: Record = {}; for (let index = 0; index < 10; index++) { primaryColorObj[`primary-${index + 1}`] = palettes[index]; } - // const modifyVars = getThemeVariables(); const mapToken = defaultAlgorithm(defaultSeed); const v3Token = convertLegacyToken(mapToken); - return { ...v3Token, // reference: Avoid repeated references @@ -47,6 +43,5 @@ export function generateModifyVars() { 'font-size-base': '14px', // Main font size 'border-radius-base': '2px', // Component/float fillet 'link-color': primary, // Link color - 'app-content-background': '#fafafa', // Link color }; } diff --git a/src/components/Application/src/AppDarkModeToggle.vue b/src/components/Application/src/AppDarkModeToggle.vue index 6ab8c402b12..3a851786e62 100644 --- a/src/components/Application/src/AppDarkModeToggle.vue +++ b/src/components/Application/src/AppDarkModeToggle.vue @@ -10,7 +10,14 @@ import { SvgIcon } from '/@/components/Icon'; import { useDesign } from '/@/hooks/web/useDesign'; import { useRootSetting } from '/@/hooks/setting/useRootSetting'; - import { updateHeaderBgColor, updateSidebarBgColor } from '/@/logics/theme/updateBackground'; + import { + updateTextColor, + updateBorderColor, + updateHeaderBgColor, + updateSidebarBgColor, + updateComponentBgColor, + updateAppContentBgColor, + } from '/@/logics/theme/updateBackground'; import { updateDarkTheme } from '/@/logics/theme/dark'; import { ThemeEnum } from '/@/enums/appEnum'; @@ -30,8 +37,12 @@ const darkMode = getDarkMode.value === ThemeEnum.DARK ? ThemeEnum.LIGHT : ThemeEnum.DARK; setDarkMode(darkMode); updateDarkTheme(darkMode); + updateTextColor(); + updateBorderColor(); updateHeaderBgColor(); updateSidebarBgColor(); + updateComponentBgColor(); + updateAppContentBgColor(); }