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

Function encapsulateStyle

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

shimCssTextMethod · 0.95
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…