lume / element

Fast and simple custom elements.
https://lume.io
MIT License
116 stars 3 forks source link

Use constructable stylesheets for element styling #1

Open trusktr opened 4 years ago

trusktr commented 4 years ago

This is a more performant way to share a common styling across instances of a custom element. Not all browsers support it yet, and the API may change a little before the spec settles.

Explainer: https://developers.google.com/web/updates/2019/02/constructable-stylesheets

Polyfill: https://github.com/calebdwilliams/construct-style-sheets

trusktr commented 9 months ago

Safari supports this out of the box now, time to implement this!

trusktr commented 4 months ago

Related: when we implement this,

will not apply while styles are adopted (behaves similar to appending to end of ShadowRoot).