The API provides a way to create CSSStyleSheet objects from script without needing <style> or <link> elements. Script can optionally modify the stylesheet by adding, removing, or replacing rules in it. Each stylesheet object can then be adopted/used in multiple tree scopes (document/shadow roots). Not only does this reduce memory duplication, it also allows an element’s styles to be modified in a single location.
Demo
Specification
Status in Chromium
Enabled by default (tracking bug) in:
- Chrome for desktop release 73
- Chrome for Android release 73
- Android WebView release 73
Consensus & Standardization
After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.
- Positive
- No signal
- No signal
- Positive
Owners
Search tags
CSS, StyleSheet, Custom Elements,Last updated on 2020-11-19