← Back to release summary

Constructible Stylesheets

Category
CSS
Type
New or changed feature
Status
Enabled by default (Chrome 73)
Intent stage
None

Summary

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.

Standards & signals

Samples: https://github.com/WICG/construct-stylesheets/blob/gh-pages/explainer.md

View on chromestatus.com