mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit adds information to the view encapsulation guide that describes the styling interactions between components that use differing view encapsulation modes. Closes #40715 PR Close #42397
15 lines
501 B
TypeScript
15 lines
501 B
TypeScript
import { Component, ViewEncapsulation } from '@angular/core';
|
|
|
|
// #docregion
|
|
@Component({
|
|
selector: 'app-shadow-dom-encapsulation',
|
|
template: `
|
|
<h2>ShadowDom</h2>
|
|
<div class="shadow-message">Shadow DOM encapsulation</div>
|
|
<app-emulated-encapsulation></app-emulated-encapsulation>
|
|
<app-no-encapsulation></app-no-encapsulation>
|
|
`,
|
|
styles: ['h2, .shadow-message { color: blue; }'],
|
|
encapsulation: ViewEncapsulation.ShadowDom,
|
|
})
|
|
export class ShadowDomEncapsulationComponent { }
|