Fix theme rgb creation (#3738)

This commit is contained in:
Bram Kragten 2019-09-17 14:08:48 +02:00 committed by GitHub
parent fad2f1790f
commit 058b4ba658
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
});
}