mayank99 / open-styleable

experimental server+client "polyfill" for openly styling shadow-roots
https://open-styleable.mynk.app/
MIT License
2 stars 1 forks source link

support client-side rendering #2

Closed mayank99 closed 6 months ago

mayank99 commented 6 months ago

Similar to <template adoptstyles="…">, there could be a way to adopt styles imperatively.

this.attachShadow({
  mode: "open",
  adoptStyles: "inherit",
});

This could be achieved by overriding attachShadow very early in the <head>. And it should take into account both .styleSheets and .adoptedStyleSheets.