Document.styleSheetSets is a deprecated read-only instance property that returns a live list of available style sheet set names. Learn how MDN builds the list from styleSheets titles, populate a theme picker UI, compare with related set properties, and modern alternatives.
01
Kind
Read-only list
02
Items
Set name strings
03
Status
Deprecated
04
Live
Updates with DOM
05
Built from
styleSheets
06
Prefer
CSS class themes
Fundamentals
Introduction
Legacy pages with multiple alternate stylesheets needed a way to list every named theme the user could pick. document.styleSheetSets exposed those names as a live list so scripts could build menus or radio buttons.
MDN: the styleSheetSets read-only property returns a live list of all of the currently-available style sheet sets.
💡
Names, not stylesheet objects
Unlike styleSheets, which returns CSSStyleSheet objects, this property returns string titles of named sets. Use selectedStyleSheetSet to switch the active set in supporting browsers.
Because MDN marks the API deprecated and non-standard, missing support is normal.
Example 2 — Loop Available Set Names
Log each name when the API is present.
JavaScript
if ("styleSheetSets" in document) {
for (const name of document.styleSheetSets) {
console.log(name);
}
} else {
console.log("Property not available");
}
Classic pattern for a browser-style theme picker in legacy Firefox-era pages.
Example 4 — Compare Sets List with Selected Set
Show available names alongside the active set.
JavaScript
function reportSets() {
if (!("styleSheetSets" in document)) {
return "Style sheet set API not supported";
}
const available = [...document.styleSheetSets];
return {
available,
selected: document.selectedStyleSheetSet
};
}
console.log(reportSets());
Document.styleSheetSets is marked Deprecated and Non-standard on MDN. Do not rely on it in new apps. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Deprecated · Non-standard
Document.styleSheetSets
Legacy live list of available alternate style sheet set names.
LegacyAvoid in new code
Google ChromeGenerally not available
No / removed
Mozilla FirefoxLegacy / may be limited
Legacy only
Apple SafariNot reliable
No / limited
Microsoft EdgeChromium — generally not available
No / removed
OperaFollow Chromium
No / removed
Internet ExplorerLegacy era only
Legacy only
Document.styleSheetSetsLimited / removed
Bottom line: Feature-detect if you must read legacy code. Prefer your own theme config with CSS classes, custom properties, or adoptedStyleSheets.
Wrap Up
Conclusion
Document.styleSheetSets exposed every named alternate stylesheet set on a page as a live string list. MDN deprecates the entire API. Modern theme pickers should use your own configuration with CSS classes, custom properties, or adoptedStyleSheets.
Confuse set name strings with CSSStyleSheet objects
Expect untitled stylesheets to appear in the list
Rely on case-insensitive duplicate handling (MDN: case-sensitive)
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about document.styleSheetSets
Legacy live list of alternate set name strings.
5
Core concepts
📄01
Returns
string list
MDN
📝02
Built from
titles
MDN
⚠️03
Status
deprecated
Avoid
🔄04
Live
DOM sync
List
✅05
Prefer
CSS themes
Modern
❓ Frequently Asked Questions
A live list of all currently available style sheet set names on the document (MDN). Each item is a string title identifying a set.
Yes. MDN marks Document.styleSheetSets as Deprecated and Non-standard. Do not use it in new code.
MDN Notes: enumerate document.styleSheets in order, add each sheet title that has a title, and drop duplicates using a case-sensitive comparison.
No. styleSheets returns CSSStyleSheet objects. styleSheetSets returns deduplicated string names of alternate sets derived from those sheets titles.
No. MDN describes it as read-only. To switch sets in the legacy API, assign selectedStyleSheetSet instead.
Build a list from your own theme config, toggle a class on document.documentElement, use CSS custom properties, or adoptedStyleSheets.
Did you know?
MDN Notes say the available set list is built by walking document.styleSheets in order and collecting each sheet’s title, skipping sheets without a title and removing duplicates with a case-sensitive comparison.