mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 01:06:35 +00:00
Fix theme rgb creation (#3738)
This commit is contained in:
parent
fad2f1790f
commit
058b4ba658
@ -44,14 +44,15 @@ export default function applyThemesOnElement(
|
|||||||
if (key.startsWith("rgb")) {
|
if (key.startsWith("rgb")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const rgbKey = `--rgb-${key}`;
|
const rgbKey = `rgb-${key}`;
|
||||||
if (theme[rgbKey] === undefined) {
|
if (theme[rgbKey] !== undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
element._themes[rgbKey] = "";
|
const prefixedRgbKey = `--${rgbKey}`;
|
||||||
|
element._themes[prefixedRgbKey] = "";
|
||||||
const rgbValue = hexToRgb(theme[key]);
|
const rgbValue = hexToRgb(theme[key]);
|
||||||
if (rgbValue !== null) {
|
if (rgbValue !== null) {
|
||||||
styles[rgbKey] = rgbValue;
|
styles[prefixedRgbKey] = rgbValue;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user