Skip to content

Commit

Permalink
no need for :root to be first in the selector
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Sep 24, 2016
1 parent 7ce981b commit 63433c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/style-properties.html
Expand Up @@ -285,11 +285,11 @@
return {properties: props, key: o};
},

_rootSelector: /(?:^:root)|(?::host\s*>\s*\*)/,
_rootSelector: /:root|:host\s*>\s*\*/,

_checkRoot: function(hostScope, selector) {
return Boolean(selector.match(this._rootSelector)) ||
(hostScope === 'html' && selector.indexOf('html') === 0);
(hostScope === 'html' && selector.indexOf('html') > -1);
},

whenHostOrRootRule: function(scope, rule, style, callback) {
Expand All @@ -311,7 +311,7 @@
var cssBuild = scope.__cssBuild || style.__cssBuild;
if (cssBuild === 'shady') {
// :root -> x-foo > *.x-foo for elements and html for custom-style
isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;
isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') > -1;
// :host -> x-foo for elements, but sub-rules have .x-foo in them
isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;
}
Expand Down

0 comments on commit 63433c8

Please sign in to comment.