The adoptedStyleSheets property holds an array of constructedCSSStyleSheet objects applied to the document. Learn how to build styles with new CSSStyleSheet(), adopt them with push(), update rules live with insertRule(), and share sheets with Shadow DOM—with five examples and try-it labs.
01
Kind
Instance property
02
Type
CSSStyleSheet[]
03
Build with
CSSStyleSheet()
04
Mutate
push / insertRule
05
Share
Shadow DOM
06
Status
Baseline widely
Fundamentals
Introduction
Most pages load CSS from <link> tags or @import. A constructed stylesheet is different: you create it in JavaScript with new CSSStyleSheet() and add rules programmatically.
document.adoptedStyleSheets is where those constructed sheets are registered on the document. Once adopted, their rules participate in the normal CSS cascade—MDN notes they are ordered afterdocument.styleSheets when specificity and order are resolved.
💡
Constructed vs linked CSS
Linked stylesheets are created by the browser when you import a file. Constructed sheets are built in JS—ideal for component libraries, design tokens, and sharing one sheet across light DOM and shadow roots.
An instance property whose value is an array of CSSStyleSheet instances. Each sheet must have been created with the CSSStyleSheet() constructor in the same document context.
Value — a mutable array; use push(), splice(), or assign a new array.
Live updates — changing rules on a sheet updates every document or shadow root that adopted it.
Cascade — adopted sheets apply alongside regular stylesheets via the CSS cascade algorithm.
Same-document only — sheets from another document (iframe) throw when adopted.
Baseline Widely available on MDN (since March 2023).
Foundation
📝 Syntax
JavaScript
document.adoptedStyleSheets
Value
An array of CSSStyleSheet objects constructed in the current document.
Build a constructed sheet and adopt it on the document.
Example 1 — MDN Adopt a Stylesheet
Create a sheet, add a rule with replaceSync, then push it.
JavaScript
const sheet = new CSSStyleSheet();
sheet.replaceSync("a { color: red; }");
document.adoptedStyleSheets.push(sheet);
// All <a> links on the page can now render red (if no higher-specificity rule wins)
Document.adoptedStyleSheets is marked Baseline Widely available on MDN (since March 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
Document.adoptedStyleSheets
Mutable CSSStyleSheet[] for constructed styles — share across document and Shadow DOM.
UniversalWidely available
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerNo constructed stylesheet support
No
Document.adoptedStyleSheetsExcellent
Bottom line: Use new CSSStyleSheet(), add rules with replaceSync or insertRule, then push onto document.adoptedStyleSheets. Share the same instance with shadowRoot.adoptedStyleSheets for component styling.
Wrap Up
Conclusion
document.adoptedStyleSheets is the standard way to attach JavaScript-built CSSStyleSheet objects to a page. Build rules programmatically, adopt with push, and share the same sheet with shadow roots for consistent component styling.
Create sheets with new CSSStyleSheet() in the same document
Use push() to add sheets to adoptedStyleSheets
Share one sheet instance across document and shadow roots when possible
Feature-detect before relying on constructed stylesheets
Keep fallback CSS for browsers without support
❌ Don’t
Adopt sheets constructed in another document or iframe
Assume adopted sheets beat every linked stylesheet (cascade still applies)
Forget that mutating a shared sheet affects all adopters
Mix up adoptedStyleSheets with styleSheets
Skip error handling when experimenting with cross-document sheets
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about adoptedStyleSheets
Programmatic CSS adoption on every Document.
5
Core concepts
📄01
Array
CSSStyleSheet[]
Type
🛠02
Build
CSSStyleSheet()
Create
🔗03
Share
shadow DOM
Pattern
🔄04
Live
insertRule
Update
🎯05
Baseline
since Mar 2023
Status
❓ Frequently Asked Questions
It is an instance property that holds an array of constructed CSSStyleSheet objects applied to the document. You add sheets created with new CSSStyleSheet() in the same document context.
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 needed.
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 (such as an iframe) throw when added.
Adopted sheets participate in the normal CSS cascade. MDN states they are treated as coming after sheets in document.styleSheets when order matters.
Did you know?
In an earlier spec revision, adoptedStyleSheets was not mutable—you had to assign a whole new array to add a sheet. Modern browsers support in-place mutations like push(), which is the pattern MDN recommends today.