Skip to content

Commit 63433c8

Browse files
committed
no need for :root to be first in the selector
1 parent 7ce981b commit 63433c8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/lib/style-properties.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@
285285
return {properties: props, key: o};
286286
},
287287

288-
_rootSelector: /(?:^:root)|(?::host\s*>\s*\*)/,
288+
_rootSelector: /:root|:host\s*>\s*\*/,
289289

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

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

0 commit comments

Comments
 (0)