mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +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")) {
|
||||
return;
|
||||
}
|
||||
const rgbKey = `--rgb-${key}`;
|
||||
if (theme[rgbKey] === undefined) {
|
||||
const rgbKey = `rgb-${key}`;
|
||||
if (theme[rgbKey] !== undefined) {
|
||||
return;
|
||||
}
|
||||
element._themes[rgbKey] = "";
|
||||
const prefixedRgbKey = `--${rgbKey}`;
|
||||
element._themes[prefixedRgbKey] = "";
|
||||
const rgbValue = hexToRgb(theme[key]);
|
||||
if (rgbValue !== null) {
|
||||
styles[rgbKey] = rgbValue;
|
||||
styles[prefixedRgbKey] = rgbValue;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user