|
|
|
|
@ -187,6 +187,20 @@ function apply_selector(relative_selectors, rule, element) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Mark both the compound selector and the node it selects as encapsulated,
|
|
|
|
|
* for transformation in a later step
|
|
|
|
|
* @param {Compiler.Css.RelativeSelector} relative_selector
|
|
|
|
|
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} node
|
|
|
|
|
*/
|
|
|
|
|
function mark(relative_selector, node) {
|
|
|
|
|
if (!is_outer_global(relative_selector)) {
|
|
|
|
|
relative_selector.metadata.scoped = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
node.metadata.scoped = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @param {Compiler.Css.Combinator} combinator
|
|
|
|
|
@ -262,20 +276,6 @@ function apply_combinator(combinator, relative_selector, parent_selectors, rule,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Mark both the compound selector and the node it selects as encapsulated,
|
|
|
|
|
* for transformation in a later step
|
|
|
|
|
* @param {Compiler.Css.RelativeSelector} relative_selector
|
|
|
|
|
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} node
|
|
|
|
|
*/
|
|
|
|
|
function mark(relative_selector, node) {
|
|
|
|
|
if (!is_outer_global(relative_selector)) {
|
|
|
|
|
relative_selector.metadata.scoped = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
node.metadata.scoped = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns `true` if the relative selector is global, meaning
|
|
|
|
|
* it's a `:global(...)` or unscopeable selector, or
|
|
|
|
|
|