One common pattern for element authors (now that import attributes enable folks to import css files directly) is to adopt imported style sheets into a shadow root at custom element initialization time.
This adds two static getters — shadowRootInit and styleSheets. The goal is to make shadow root initialization as declarative as possible. Note that we still expose createRenderRoot so we don’t get in the way if folks need to do something more advanced (it’s also still the only way to forgo the creation of a shadow root at all).
@klebba — This is more-or-less what I figured we’d do here. It’s pretty straightforward, just a way to declare things in isolation as an ergonomic benefit.
One common pattern for element authors (now that import attributes enable folks to import css files directly) is to adopt imported style sheets into a shadow root at custom element initialization time.
This adds two static getters —
shadowRootInit
andstyleSheets
. The goal is to make shadow root initialization as declarative as possible. Note that we still exposecreateRenderRoot
so we don’t get in the way if folks need to do something more advanced (it’s also still the only way to forgo the creation of a shadow root at all).Closes #52.