From 223017768020f8d5c3a73120e07f2a3727ba6018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Tue, 29 Nov 2022 11:41:40 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=A0=B9=E6=8D=AE=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E6=B7=B7=E5=90=88=E5=AF=BC=E8=88=AA=E6=A0=8F?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/default-theme.scss | 2 ++ src/utils/theme/color.js | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/styles/default-theme.scss b/src/styles/default-theme.scss index 81176ba56..b95d55432 100644 --- a/src/styles/default-theme.scss +++ b/src/styles/default-theme.scss @@ -8,6 +8,7 @@ --menu-text: #646A73; --menu-hover: #f4faf9; --submenu-bg: #ffffff; + --nav-bg: #148f76; } :export { @@ -20,4 +21,5 @@ --menu-text: #646A73; --menu-hover: #f4faf9; --submenu-bg: #ffffff; + --nav-bg: #148f76; } diff --git a/src/utils/theme/color.js b/src/utils/theme/color.js index 00e62bad3..aaf2cf76c 100644 --- a/src/utils/theme/color.js +++ b/src/utils/theme/color.js @@ -68,9 +68,12 @@ export function changeMenuColor(themeColors) { const colors = Object.keys(themeColors).length > 0 ? themeColors : defaultThemeConfig const colorValue = colors['--color-primary'].replace(/#/g, '') - const black = 'ffffff' - const menuHoverColor = mix(black, colorValue, 96) + const white = 'ffffff' + const black = '000000' + const menuHoverColor = mix(white, colorValue, 96) + const navBackgroundColor = mix(black, colorValue, 20) elementStyle.setProperty('--menu-hover', menuHoverColor) + elementStyle.setProperty('--nav-bg', navBackgroundColor) for (const key in colors) { const currentColor = colors[key]