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

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

Thank you for the feedback! I recently updated [the explainer](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md) to respond to these questions. I will link to individual sections as responses to help clarify things.

> It would be good for the explainer to show the HTML for the sort of component nesting that requires the proposed solution.

The explainer has been updated with a [Streaming SSR](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#streaming-ssr) example of this scenario and how this solution addresses it.

> Please avoid showing specifiers like this, or if it's the intention to allow these to behave like URLs, make that clear and detail how it's expected to work.

[This section of the explainer](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#detailed-parsing-workflow) has been updated with a step-by-step workflow of how we expect these specifiers to interact with the module map.

> Was it ever intentional that `<script type="importmap">` works inside a shadow root? 

Good question. I will follow up with @domenic offline to resolve this. In the mean time, I'll add this to the explainer as an open issue.

> Please look for ways to make the syntaxes more similar, for example by giving `<link rel="adopt stylesheet">` the by-reference semantics

This is a great suggestion, and allows for more flexibility with this proposal (`@sheet`, media queries, etc.). The specifics should be discussed with WHATWG stakeholders. In the mean time, I have added this to the explainer [here](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#using-a-link-tag-to-adopt-stylesheets).

> What if, instead, we defined a way to name style elements or @sheets across shadow boundaries?

As mentioned in the [updated explainer](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#sheet), `@sheet` alone won't be a replacement for this feature due to the fact that there's no mechanism to include an `@sheet` with inline styles - they must be in an external file. Inline styles are a key part of the [Streaming SSR](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#streaming-ssr) scenario that this proposal allows. I will note that using a [link tag](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#using-a-link-tag-to-adopt-stylesheets) to adopt styles will allow for clean integration with `@sheet` (without requiring names to cross shadow boundaries).


> Because the current specifier attribute does expose its element across shadow boundaries, it might be better to name it in a way that flags this behavior. Perhaps exportspecifier.

Great idea, this has been incorporated into [the explainer](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md#proposal-inline-declarative-css-module-scripts).

> You have adoptedstylesheets taking a comma-separated list of specifiers, but we have a design principle that it should be space-separated.

[The explainer](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ShadowDOM/explainer.md) has been updated accordingly.

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

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

Received on Tuesday, 19 August 2025 18:55:51 UTC