perf: 根据系统颜色混合导航栏颜色

This commit is contained in:
“huailei000”
2022-11-29 11:41:40 +08:00
committed by huailei
parent 1279015c28
commit 2230177680
2 changed files with 7 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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]