LoadCSS Project

LoadCSS: High-Priority Asynchronous CSS Loading Demo

This test page demonstrates a new pattern for loading a stylesheet asynchronously at a low priority. The page will turn green when the CSS loads.


<link rel="alternate stylesheet preload" href="slow.css" title="styles" as="style" onload="this.title='';this.rel='stylesheet'">

Instead of the usual print toggle, this page is loading CSS with rel="alternate stylesheet preload", which will load async at a high priority. On load, the rel is set to stylesheet and title is turned off, causing it to apply. What's nice about this pattern is you can lower the priority by removing the rel value of "preload" to decrease its priority from high to low. View low priority async demo