The future of loading CSS

It’s soon OK to link to stylesheets directly from anywhere inside the <body> without having FOUCs:

The plan is for each <link rel="stylesheet"> to block rendering of subsequent content while the stylesheet loads, but allow the rendering of content before it. The stylesheets load in parallel, but they apply in series. This makes <link rel="stylesheet"> behave similar to <script src="…"></script>.

A use case could be for taking a component based approach, each with its own CSS file that you load up just before you actually use it.

Already works nice in IE/Edge, and Firefox (with a little fix). The proposed behaviour is planned to land in Chromium.

The future of loading CSS →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.