MCPcopy Create free account
hub / github.com/angular/angular / _stripScopingSelectors

Method _stripScopingSelectors

packages/compiler/src/shadow_css.ts:647–654  ·  view source on GitHub ↗

* Handle a css text that is within a rule that should not contain scope selectors by simply * removing them! An example of such a rule is `@font-face`. * * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector. * Normally this would be a syntax error

(cssText: string)

Source from the content-addressed store, hash-verified

645 * ```
646 */
647 private _stripScopingSelectors(cssText: string): string {
648 return processRules(cssText, (rule) => {
649 const selector = rule.selector
650 .replace(_shadowDeepSelectors, ' ')
651 .replace(_polyfillHostNoCombinatorRe, ' ');
652 return new CssRule(selector, rule.content, rule.isBlock);
653 });
654 }
655
656 private _safeSelector: SafeSelector | undefined;
657 private _shouldScopeIndicator: boolean | undefined;

Callers 1

_scopeSelectorsMethod · 0.95

Calls 2

processRulesFunction · 0.85
replaceMethod · 0.45

Tested by

no test coverage detected