1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +02:00

fix(css): improve the handling of different color entries EE-3603 (#7134)

This commit is contained in:
andres-portainer 2022-06-27 18:11:14 -03:00 committed by GitHub
parent cd19eb036b
commit 8eff32ebc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,15 @@ const element = document.createElement('style');
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')}
}`;