You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constructible stylesheets are soon coming to the web platform. They should provide a significant performance improvement for styling Shadow DOM!
The intention of the API is to allow sharing of stylesheets between shadowRoots that use the same styling, and this is a perfect fit for custom elements. It does strongly discourage modifying styles per instance since the stylesheet would be shared across all elements of a given type.
Because of this, it may not make sense for users to put non-dynamic <style> elements into the render method since it looks like these styles can change. Although this is not the case when shady-render is used, that's a polyfill specific limitation rather than part of the core design.
Perhaps a static get style() could be added which is how users declare element styling.
If so, we either need to integrate this feature with shady-render or stop using it.
We should probably consider if this is worth doing prior to a 1.0 release.
The text was updated successfully, but these errors were encountered:
Constructible stylesheets are soon coming to the web platform. They should provide a significant performance improvement for styling Shadow DOM!
The intention of the API is to allow sharing of stylesheets between
shadowRoots
that use the same styling, and this is a perfect fit for custom elements. It does strongly discourage modifying styles per instance since the stylesheet would be shared across all elements of a given type.Because of this, it may not make sense for users to put non-dynamic
<style>
elements into therender
method since it looks like these styles can change. Although this is not the case whenshady-render
is used, that's a polyfill specific limitation rather than part of the core design.Perhaps a
static get style()
could be added which is how users declare element styling.If so, we either need to integrate this feature with
shady-render
or stop using it.We should probably consider if this is worth doing prior to a 1.0 release.
The text was updated successfully, but these errors were encountered: