-
Notifications
You must be signed in to change notification settings - Fork 33
Constructable Stylesheets & adoptedStyleSheets #204
Copy link
Copy link
Closed
Labels
acceptedAn accepted proposalAn accepted proposalfocus-area-proposalFocus Area ProposalFocus Area Proposal
Description
Description
Constructable Stylesheets and adoptedStyleSheets enable adding styles directly to DOM trees, e.g. document and shadow roots, without creating new DOM elements. Because a single stylesheet object can be adopted by multiple scopes, it also allows sharing of styles that can be centrally modified.
General consensus; shipped in both Chrome and Firefox, not available in Safari
Rationale
- There is no effective way to share styles across components while allowing them to be centrally modified.
- Creating <style> elements for each style used in each shadow root has a measurable performance overhead.
- CSS Module Scripts, another critical feature, depends on constructible stylesheets.
Specification
https://w3c.github.io/csswg-drafts/cssom-1/
Tests
Those including "constructable" in https://github.com/web-platform-tests/wpt/tree/master/css/cssom
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedAn accepted proposalAn accepted proposalfocus-area-proposalFocus Area ProposalFocus Area Proposal