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:
Kendell R 2020-09-14 00:40:35 -07:00 committed by GitHub
parent e465ec8835
commit 709112c498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,12 +105,12 @@ const processTheme = (
const keys = {};
for (const key of Object.keys(combinedTheme)) {
const prefixedKey = `--${key}`;
const value = combinedTheme[key]!;
const value = String(combinedTheme[key]!);
styles[prefixedKey] = value;
keys[prefixedKey] = "";
// 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
continue;
}