The future of loading CSS - JakeArchibald.com
Interesting developments. Interesting solutions.
Unfortunately, with our webserver only serving HTTP/1.x, and most of our clients not understanding HTTP/2, it doesn’t make sense to split stylesheets into multiple requests.
But in the not-so-distant-future, with HTTP/2 more commonly implemented, this article describes an interesting approach to <link>
element placement.
TL;DR
Before each section of content to which the styles apply,
- load the stylesheet
- add a functionally empty
<script>
tag - add the content.
Like this, e.g.:
<link rel="stylesheet" href="/article.css">
<script> </script>
<main>…</main>