Re: [w3ctag/design-reviews] Declarative CSS Modules and Declarative Shadow DOM `adoptedstylesheets` attribute (Issue #1000)

EisenbergEffect left a comment (w3ctag/design-reviews#1000)

One hard requirement I have is that there **MUST** be a way for declarative styles added to declarative Shadow DOM to be present in the `adoptedStyleSheets` array of the shadow root and the style sheet instance **MUST** be the same across all shadow roots that reference the same declared styles.

**This is critical for libraries, frameworks, hydration, interoperability, etc.**

The runtime representation must be consistent regardless of whether things were set up declaratively or imperatively. We _already have_ a proven model for sharing styles imperatively, which is in broad use. _We just need the declarative equivalent._

Another hard requirement I have is that declarative shadow root adopted styles **MUST** be able to reference any declarative styles that have previously been parsed, regardless of their position in the node hierarchy (previous sibling, ancestor, shadow root of sibling/ancestor, etc.).

**This is critical for server rendering scenarios.**

I care much less about the syntax, but if these semantics are messed up...

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1000#issuecomment-3092440050
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1000/3092440050@github.com>

Received on Saturday, 19 July 2025 16:28:48 UTC