diff --git a/src/lib/custom-style.html b/src/lib/custom-style.html index 0cec8317a6..6e18dfbaca 100644 --- a/src/lib/custom-style.html +++ b/src/lib/custom-style.html @@ -135,11 +135,13 @@ if (this.include) { e.textContent += styleUtil.cssFromModules(this.include); } + var rules = styleUtil.rulesForStyle(e); + styleUtil.forEachStyleRule(rules, function(rule) { + styleTransformer.documentRule(rule); + }); this._computeStyleProperties(); var props = this._styleProperties; - var self = this; - e.textContent = styleUtil.toCssText(styleUtil.rulesForStyle(e), - function(rule) { + e.textContent = styleUtil.toCssText(rules, function(rule) { var css = rule.cssText = rule.parsedCssText; if (rule.propertyInfo && rule.propertyInfo.cssText) { // remove property assignments @@ -154,7 +156,6 @@ // replace with reified properties, scenario is same as mixin rule.cssText = propertyUtils.valueForProperties(css, props); } - styleTransformer.documentRule(rule); } ); } diff --git a/test/unit/custom-style.html b/test/unit/custom-style.html index 6cc2f9b0a5..c3de5ff349 100644 --- a/test/unit/custom-style.html +++ b/test/unit/custom-style.html @@ -73,6 +73,10 @@ --primary: 10px; } + body /deep/ * { + --deeep: 6px solid orange; + } +