diff --git a/src/lib/style-transformer.html b/src/lib/style-transformer.html index 81871a4834..5333e26314 100644 --- a/src/lib/style-transformer.html +++ b/src/lib/style-transformer.html @@ -292,6 +292,12 @@ normalizeRootSelector: function(rule) { rule.selector = rule.selector.replace(ROOT, 'html'); + // handle 2.x rules like `:host, html {}` + var parts = rule.selector.split(COMPLEX_SELECTOR_SEP); + parts = parts.filter(function(part) { + return part.trim() !== HOST; + }); + rule.selector = parts.join(COMPLEX_SELECTOR_SEP); }, _transformDocumentSelector: function(selector) { diff --git a/test/unit/custom-style.html b/test/unit/custom-style.html index 6b9c4dc3df..54a4cf7ea0 100644 --- a/test/unit/custom-style.html +++ b/test/unit/custom-style.html @@ -141,6 +141,11 @@ --html-foo: 10px dotted green; } +
italic
@@ -162,6 +167,8 @@ + +

@@ -314,6 +321,16 @@ + + + + @@ -386,6 +406,11 @@ assertComputed(xFoo.$.bar3.$.baz, '5px'); }); + test('polymer 2 shared styles applied', function() { + var polymer2 = document.querySelector('polymer-2-root'); + assertComputed(polymer2, '10px'); + }) + test('custom properties registered as defaults', function() { var propsToCheck = ['--italic']; if (Polymer.Settings.useNativeCSSProperties || stylesBuilt) {