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
{{ message }}
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.
With the rise of HTTP/2, we are now able to stop concatenation our stylesheets and start to load them depending on the page needs. In his article, @jakearchibald describe some good practices to deal with multiple css files like calling them all in the <head> or better, next to the related component.
Having links in the <body> is something more HTTP/2 oriented, but not quite satisfying.
I think that HTML has to evolve a bit to fit with this more modern approach of binding styles. What if we can directly bind stylesheet on the related component ? In fact, the style attribute can already do that. So, in the same way, what if we have a similar attribute styles who call a render-contextual stylesheet ? I can be something very elegant like :
Interesting. I guess the styles in such a case would act as before, i.e. global? What about async loading of the style resource, that could help faster load by not blocking, but with the associated risk of painting something before styles are loaded and then updating later. Perhaps you should propose this on the WICG list?
We haven't heard back from the OP defending the proposal for the last 5 months, and this seems to overlap a bit (but not entirely) with <style scoped> which was dropped from the upstream spec.
The single difference I see (extrapolating a lot from the couple lines in the proposal) is that a stylesheet attached to an element would most likely start the selector scope from the element the stylesheet was attached to, which sounds neat for templates and components, but is a feature big enough that it should probably be incubated first.
I'm closing this as the OP hasn't defended over the course of a couple months - feel free to re-open or move to WICG in the event this should be pushed forward.
With the rise of HTTP/2, we are now able to stop concatenation our stylesheets and start to load them depending on the page needs. In his article, @jakearchibald describe some good practices to deal with multiple css files like calling them all in the
<head>
or better, next to the related component.Having links in the
<body>
is something more HTTP/2 oriented, but not quite satisfying.For example :
I think that HTML has to evolve a bit to fit with this more modern approach of binding styles. What if we can directly bind stylesheet on the related component ? In fact, the
style
attribute can already do that. So, in the same way, what if we have a similar attributestyles
who call a render-contextual stylesheet ? I can be something very elegant like :I don't find a similar issue (because it's too crazy), so feal free to close it quickly if it's irrelevant.
The text was updated successfully, but these errors were encountered: