mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-25 14:34:46 +00:00
perf: 修改 labels 组件
This commit is contained in:
@@ -84,11 +84,22 @@ export function changeMenuColor(themeColors) {
|
||||
colors['--menu-hover'] = menuHover
|
||||
}
|
||||
|
||||
const lights = [15, 40, 60, 80]
|
||||
const darks = [15, 30, 40, 60]
|
||||
|
||||
for (const key in colors) {
|
||||
const currentColor = colors[key]
|
||||
elementStyle.setProperty(key, currentColor)
|
||||
|
||||
if (key.includes('--color')) {
|
||||
for (const [i, light] of lights.entries()) {
|
||||
const color = mix(white, currentColor.replace(/#/g, ''), light)
|
||||
elementStyle.setProperty(key + '-light' + '-' + i, color)
|
||||
}
|
||||
for (const [i, dark] of darks.entries()) {
|
||||
const color = mix(black, currentColor.replace(/#/g, ''), dark)
|
||||
elementStyle.setProperty(key + '-dark' + '-' + i, color)
|
||||
}
|
||||
const lightColor = mix(white, currentColor.replace(/#/g, ''), 70)
|
||||
const darkColor = mix(black, currentColor.replace(/#/g, ''), 70)
|
||||
elementStyle.setProperty(key + '-light', lightColor)
|
||||
|
||||
Reference in New Issue
Block a user