mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-15 14:24:39 +00:00
Merge pull request #1904 from jumpserver/pr@dev@perf_colors
fix: theme colors default
This commit is contained in:
@@ -4,7 +4,7 @@ import defaultThemeConfig from './default.js'
|
||||
|
||||
export function generateColors(themeColors) {
|
||||
const colors = {}
|
||||
if (!themeColors) {
|
||||
if (!themeColors || Object.keys(themeColors).length === 0) {
|
||||
themeColors = defaultThemeConfig
|
||||
}
|
||||
let primaryColor = themeColors
|
||||
@@ -31,7 +31,7 @@ export function generateColors(themeColors) {
|
||||
if (value.includes('danger')) {
|
||||
replaceColor = value.replace(/danger/g, subColor['--color-danger'])
|
||||
}
|
||||
if (replaceColor) {
|
||||
if (replaceColor && !replaceColor.includes('undefined')) {
|
||||
const convertColor = color.convert(replaceColor)
|
||||
colors[key] = convertColor.indexOf('rgba') > -1 ? convertColor : colorRgbToHex(convertColor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user