adoptedStyleSheets property

JSArray<CSSStyleSheet> get adoptedStyleSheets

The adoptedStyleSheets property of the Document interface is used for setting an array of constructed stylesheets to be used by the document.

Note: A constructed stylesheet is a stylesheet created programmatically using the CSSStyleSheet() constructor (as compared to one created by a user-agent when importing a stylesheet from a script, imported using style and , or linked to via link).

The same constructed stylesheets can also be shared with one or more ShadowRoot instances using the ShadowRoot.adoptedStyleSheets property. Changing an adopted stylesheet will affect all the objects that adopt it.

Stylesheets in the property are evaluated along with the document's other stylesheets using the CSS cascade algorithm. Where the resolution of rules considers stylesheet order, adoptedStyleSheets are assumed to be ordered after those in Document.styleSheets.

Only stylesheets created using the CSSStyleSheet() constructor within the context of the current Document may be adopted.

Implementation

external JSArray<CSSStyleSheet> get adoptedStyleSheets;
set adoptedStyleSheets (JSArray<CSSStyleSheet> value)

Implementation

external set adoptedStyleSheets(JSArray<CSSStyleSheet> value);