MCPcopy Index your code
hub / github.com/angular/angular / _scopeSelectors

Method _scopeSelectors

packages/compiler/src/shadow_css.ts:593–611  ·  view source on GitHub ↗
(cssText: string, scopeSelector: string, hostSelector: string)

Source from the content-addressed store, hash-verified

591
592 // change a selector like 'div' to 'name div'
593 private _scopeSelectors(cssText: string, scopeSelector: string, hostSelector: string): string {
594 return processRules(cssText, (rule: CssRule) => {
595 let selector = rule.selector;
596 let content = rule.content;
597 if (rule.selector[0] !== '@') {
598 selector = this._scopeSelector({
599 selector,
600 scopeSelector,
601 hostSelector,
602 isParentSelector: true,
603 });
604 } else if (scopedAtRuleIdentifiers.some((atRule) => rule.selector.startsWith(atRule))) {
605 content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
606 } else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
607 content = this._stripScopingSelectors(rule.content);
608 }
609 return new CssRule(selector, content);
610 });
611 }
612
613 /**
614 * Handle a css text that is within a rule that should not contain scope selectors by simply

Callers 1

_scopeCssTextMethod · 0.95

Calls 4

_scopeSelectorMethod · 0.95
processRulesFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected