mirror of https://github.com/portainer/portainer
fix(css): improve the handling of different color entries EE-3603 (#7134)
parent
cd19eb036b
commit
8eff32ebc7
|
@ -2,9 +2,17 @@ import colors from './colors.json';
|
|||
|
||||
const element = document.createElement('style');
|
||||
|
||||
element.innerHTML = `:root {
|
||||
element.innerHTML = `:root {
|
||||
${Object.entries(colors)
|
||||
.map(([color, hex]) => `--ui-${color}: ${hex}`)
|
||||
.map(([color, hex]) => {
|
||||
if (typeof hex === 'string') {
|
||||
return `--ui-${color}: ${hex}`;
|
||||
}
|
||||
|
||||
return Object.entries(hex)
|
||||
.map(([key, value]) => `--ui-${color}-${key}: ${value}`)
|
||||
.join(';\n');
|
||||
})
|
||||
.join(';\n')}
|
||||
}`;
|
||||
|
||||
|
|
Loading…
Reference in New Issue