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

Function encapsulateStyle

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

shimCssTextMethod · 0.95
replaceMethod · 0.45

Tested by

no test coverage detected