webtides / element-js

Simple and lightweight base classes for web components with a beautiful API
MIT License
26 stars 3 forks source link

Feature/adopt all global styles #101

Closed eddyloewen closed 11 months ago

eddyloewen commented 1 year ago

With the proposed changes we will now adopt all global styles instead of just one inline style with a specific ID. I went a slightly different road than the example links I posted in #46. Instead of creating/cloning style elements and link elements in the template, I create a list of all global Styles as Constructable StyleSheets and adopt them all. I think this should work good enough. @quarkus The only thing I'm not sure of is if its ok to use the global observer to watch the whole document... Maybe we don't even need it and we should not support adding styles that come in later?