adoptedStyleSheets property
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 usingstyle
and , or linked to vialink
).
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;
Implementation
external set adoptedStyleSheets(JSArray<CSSStyleSheet> value);