Re: [WICG/webcomponents] "open-stylable" Shadow Roots (#909)

Do we think it would be possible to have a single mechanism for declarative style sheet sharing? There's not only the use case of adopting global styles into a shadow root but also declaratively sharing shadow root scoped styles across DSDs. For example, this was proposed for sharing across DSD:

```html
<script type="css" specifier="/bar.css">
  :host {
    color: red
   }
</script>

<my-element>
  <template shadowroot="open" css-modules="/foo.css /bar.css">
    <script type="css" specifier="/foo.css">
      :host {
        color: red
       }
    </script>
    <!-- ... -->
  </template>
</my-element>

<my-element>
  <template shadowroot="open" css-modules="/foo.css /bar.css">
    <!-- ... -->
  </template>
</my-element>
```

Could we also add the `specifier` attribute to `style` and `link` elements to enable those global styles to be imported into shadow roots? (As well as have this integrated with the module system...)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/909#issuecomment-1870653225
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/909/1870653225@github.com>

Received on Wednesday, 27 December 2023 22:01:03 UTC