Skip to content

Commit

Permalink
Only use setProperty when setting CSS variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Dail committed Apr 10, 2017
1 parent 7ef8f42 commit f84597a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/renderers/dom/shared/CSSPropertyOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,10 @@ var CSSPropertyOperations = {
if (styleName === 'float') {
styleName = 'cssFloat';
}
var hyphenatedStyleName = processStyleName(styleName);
if (styleValue) {
style.setProperty(hyphenatedStyleName, styleValue);
if (styleName.indexOf('--') === 0) {
style.setProperty(styleName, styleValue);
} else if (styleValue) {
style[styleName] = styleValue;
} else {
var expansion = hasShorthandPropertyBug &&
CSSProperty.shorthandPropertyExpansions[styleName];
Expand All @@ -230,7 +231,7 @@ var CSSPropertyOperations = {
style[individualStyleName] = '';
}
} else {
style.setProperty(hyphenatedStyleName, '');
style[styleName] = '';
}
}
}
Expand Down

0 comments on commit f84597a

Please sign in to comment.