mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +00:00
Do safety check before detecting hex value and handle YAML numbers better (#6956)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
e465ec8835
commit
709112c498
@ -105,12 +105,12 @@ const processTheme = (
|
|||||||
const keys = {};
|
const keys = {};
|
||||||
for (const key of Object.keys(combinedTheme)) {
|
for (const key of Object.keys(combinedTheme)) {
|
||||||
const prefixedKey = `--${key}`;
|
const prefixedKey = `--${key}`;
|
||||||
const value = combinedTheme[key]!;
|
const value = String(combinedTheme[key]!);
|
||||||
styles[prefixedKey] = value;
|
styles[prefixedKey] = value;
|
||||||
keys[prefixedKey] = "";
|
keys[prefixedKey] = "";
|
||||||
|
|
||||||
// Try to create a rgb value for this key if it is not a var
|
// Try to create a rgb value for this key if it is not a var
|
||||||
if (!value.startsWith("#")) {
|
if (value.startsWith("#")) {
|
||||||
// Can't convert non hex value
|
// Can't convert non hex value
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user