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

Function encapsulateStyle

packages/compiler/src/render3/view/compiler.ts:648–657  ·  view source on GitHub ↗
(style: string, componentIdentifier?: string)

Source from the content-addressed store, hash-verified

646 * @returns The encapsulated content for the style.
647 */
648export function encapsulateStyle(style: string, componentIdentifier?: string): string {
649 const shadowCss = new ShadowCss();
650 const selector = componentIdentifier
651 ? CONTENT_ATTR.replace(COMPONENT_VARIABLE, componentIdentifier)
652 : CONTENT_ATTR;
653 const hostSelector = componentIdentifier
654 ? HOST_ATTR.replace(COMPONENT_VARIABLE, componentIdentifier)
655 : HOST_ATTR;
656 return shadowCss.shimCssText(style, selector, hostSelector);
657}
658
659function createHostDirectivesType(meta: R3DirectiveMetadata): o.Type {
660 if (!meta.hostDirectives?.length) {

Callers

nothing calls this directly

Calls 2

shimCssTextMethod · 0.95
replaceMethod · 0.45

Tested by

no test coverage detected