• Overview
@angular/core

ViewEncapsulation

enum

Defines the CSS styles encapsulation policies for the Component decorator's encapsulation option.

  
    enum ViewEncapsulation {}
  
  

Emulated

Emulates a native Shadow DOM encapsulation behavior by adding a specific attribute to the component's host element and applying the same attribute to all the CSS selectors provided via styles or styleUrls.

This is the default option.

None

Doesn't provide any sort of CSS style encapsulation, meaning that all the styles provided via styles or styleUrls are applicable to any HTML element of the application regardless of their host Component.

ShadowDom

Uses the browser's native Shadow DOM API to encapsulate CSS styles, meaning that it creates a ShadowRoot for the component's host element which is then used to encapsulate all the Component's styling.

Jump to details