mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-24 13:54:50 +00:00
perf: 修改 detail card
This commit is contained in:
@@ -90,22 +90,20 @@ export function changeMenuColor(themeColors) {
|
||||
colors['--menu-hover'] = mix(white, menuActiveTextColor.replace(/#/g, ''), 90)
|
||||
}
|
||||
|
||||
const lights = [15, 40, 60, 80]
|
||||
const darken = [15, 30, 40, 60]
|
||||
const lights = [15, 40, 60, 80, 90]
|
||||
const darken = [15, 30, 40, 60, 80]
|
||||
|
||||
for (const key in colors) {
|
||||
const currentColor = colors[key]
|
||||
elementStyle.setProperty(key, currentColor)
|
||||
|
||||
if (key === '--color-primary') {
|
||||
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 darken.entries()) {
|
||||
const color = mix(black, currentColor.replace(/#/g, ''), dark)
|
||||
elementStyle.setProperty(key + '-dark' + '-' + i, 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 darken.entries()) {
|
||||
const color = mix(black, currentColor.replace(/#/g, ''), dark)
|
||||
elementStyle.setProperty(key + '-dark' + '-' + i, color)
|
||||
}
|
||||
|
||||
if (key.includes('--color')) {
|
||||
|
||||
@@ -47,6 +47,9 @@ export function changeElementColor(themeColors) {
|
||||
.el-tag--dark.el-tag--${key} {
|
||||
background-color: ${value} !important;
|
||||
}
|
||||
.el-alert.el-alert--${key}.is-light {
|
||||
background-color: var(--color-${key}-light-4);
|
||||
}
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user