Document.adoptedStyleSheets is an array of constructedCSSStyleSheet objects applied to the document (MDN). You build sheets with new CSSStyleSheet(), add rules in JavaScript, then adopt them so they join the normal CSS cascade.
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use document.adoptedStyleSheets. Start with this line.
JavaScript
document.adoptedStyleSheets
Call
What it does
document.adoptedStyleSheets
Primary signature.
Built into the browser. Read or assign document.adoptedStyleSheets — no import required.
Library declarations
JavaScript
document.adoptedStyleSheets
Parameters
Parameter
Description
new CSSStyleSheet()
Required. Constructed sheet in this document
Rules (replaceSync / insertRule)
Required. Fill or update CSS text
adoptedStyleSheets
Required. Registers the sheet on the document
Feature detect
Optional. Guard older browsers
Return Value
Return Value
Description
*
The current value of document.adoptedStyleSheets.
JavaScript Examples
Example 1 — Adopt a Constructed Stylesheet
Create a sheet, fill it with replaceSync, then push it onto the document.
One instance. Document and shadow adopt the samesheet object.
Shadow assignment.shadow.adoptedStyleSheets = [sheet] attaches it to the shadow tree.
Shared updates. Later insertRule / replaceSync calls update every adopter.
Identity check.=== is true because both arrays hold the same reference.
Compatibility
Browser Support
Document.adoptedStyleSheets is Baseline Widely available on MDN (since March 2023). Constructed stylesheets work across modern evergreen browsers.
✓ Baseline · Widely available
Document.adoptedStyleSheets
Mutable CSSStyleSheet[] for constructed styles — share across document and Shadow DOM.
96%Modern browser support
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
adoptedStyleSheetsExcellent
Bottom line: Safe for modern web apps. Feature-detect with "adoptedStyleSheets" in document and fall back to <style> injection when needed. Not available in Internet Explorer.
Frequently Asked Questions
It holds an array of constructed CSSStyleSheet objects applied to the document. You create sheets with new CSSStyleSheet() in the same document, then push or assign them onto adoptedStyleSheets.
No. MDN marks Document.adoptedStyleSheets as Baseline Widely available (since March 2023). It is not Deprecated, Experimental, or Non-standard.
Create a sheet with new CSSStyleSheet(), add rules with replaceSync() or insertRule(), then push it onto document.adoptedStyleSheets. You can also assign a new array if you need a full replace.
Yes. The same CSSStyleSheet instance can be adopted on document.adoptedStyleSheets and on shadowRoot.adoptedStyleSheets. Editing the sheet updates every adopter.
Only sheets constructed with CSSStyleSheet() in the current document may be adopted. Sheets from another document (for example an iframe) throw a NotAllowedError DOMException when added.
Adopted sheets participate in the normal CSS cascade. MDN states they are treated as coming after sheets in document.styleSheets when stylesheet order matters.