element icon indicating copy to clipboard operation
element copied to clipboard

Use constructable stylesheets for element styling

Open trusktr opened this issue 4 years ago • 2 comments

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 avatar May 10 '20 06:05 trusktr

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

trusktr avatar Nov 21 '23 03:11 trusktr

Related: when we implement this,

  • https://github.com/lume/element/issues/12

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

trusktr avatar Apr 08 '24 21:04 trusktr