mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 22:09:41 +02:00
fix(css): improve the handling of different color entries EE-3603 (#7134)
This commit is contained in:
parent
cd19eb036b
commit
8eff32ebc7
1 changed files with 10 additions and 2 deletions
|
@ -2,9 +2,17 @@ import colors from './colors.json';
|
||||||
|
|
||||||
const element = document.createElement('style');
|
const element = document.createElement('style');
|
||||||
|
|
||||||
element.innerHTML = `:root {
|
element.innerHTML = `:root {
|
||||||
${Object.entries(colors)
|
${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')}
|
.join(';\n')}
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue