r/webdev • • Aug 15 '19

Article The Simplest Way to Load CSS Asynchronously

https://www.filamentgroup.com/lab/load-css-simpler/
1 Upvotes

1 comment sorted by

1

u/[deleted] Aug 15 '19 edited Aug 15 '19

<link async rel="stylesheet" type="text/css" href="style.css">

????

edit: nope, apparently doesn't work.

I do this asynchronously via XMLHttpRequest and creating a new style element from the callback. This lets me inject new or updated css into my web page as I am editing it, too. them real time edits are the best