2016-06-23 09:47:54 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
|
*/
|
|
|
|
|
|
2015-10-05 10:10:07 -07:00
|
|
|
/**
|
2016-07-07 23:02:35 -07:00
|
|
|
* Defines template and style encapsulation options available for Component's {@link Component}.
|
2015-10-05 10:10:07 -07:00
|
|
|
*
|
2017-10-13 22:27:38 +03:00
|
|
|
* See {@link Component#encapsulation encapsulation}.
|
2018-04-05 22:31:44 +01:00
|
|
|
*
|
2015-10-05 10:10:07 -07:00
|
|
|
*/
|
|
|
|
|
export enum ViewEncapsulation {
|
|
|
|
|
/**
|
|
|
|
|
* Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
|
2017-10-13 22:27:38 +03:00
|
|
|
* Element and pre-processing the style rules provided via {@link Component#styles styles} or
|
|
|
|
|
* {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all
|
|
|
|
|
* selectors.
|
2015-10-05 10:10:07 -07:00
|
|
|
*
|
|
|
|
|
* This is the default option.
|
|
|
|
|
*/
|
2017-08-16 09:00:03 -07:00
|
|
|
Emulated = 0,
|
2015-10-05 10:10:07 -07:00
|
|
|
/**
|
2018-06-28 12:42:04 -07:00
|
|
|
* @deprecated v6.1.0 - use {ViewEncapsulation.ShadowDom} instead.
|
2015-10-05 10:10:07 -07:00
|
|
|
* Use the native encapsulation mechanism of the renderer.
|
|
|
|
|
*
|
2018-06-28 12:42:04 -07:00
|
|
|
* For the DOM this means using the deprecated [Shadow DOM
|
|
|
|
|
* v0](https://w3c.github.io/webcomponents/spec/shadow/) and
|
2015-10-05 10:10:07 -07:00
|
|
|
* creating a ShadowRoot for Component's Host Element.
|
|
|
|
|
*/
|
2017-08-16 09:00:03 -07:00
|
|
|
Native = 1,
|
2015-10-05 10:10:07 -07:00
|
|
|
/**
|
|
|
|
|
* Don't provide any template or style encapsulation.
|
|
|
|
|
*/
|
2018-06-28 12:42:04 -07:00
|
|
|
None = 2,
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Use Shadow DOM to encapsulate styles.
|
|
|
|
|
*
|
|
|
|
|
* For the DOM this means using modern [Shadow
|
|
|
|
|
* DOM](https://w3c.github.io/webcomponents/spec/shadow/) and
|
|
|
|
|
* creating a ShadowRoot for Component's Host Element.
|
|
|
|
|
*
|
|
|
|
|
* ### Example
|
|
|
|
|
* {@example core/ts/metadata/encapsulation.ts region='longform'}
|
|
|
|
|
*/
|
|
|
|
|
ShadowDom = 3
|
2015-06-12 23:51:42 -07:00
|
|
|
}
|