Created
June 27, 2019 09:43
-
-
Save jmak/f3120d73ba1ed390a629c2a6ecf82996 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Similar to the media toggle approach, we could also load CSS asynchronously by marking a link as an alternate stylesheet (designed to offer the user alternate presentations of a site), and then using JavaScript to toggle the rel attribute back to stylesheet when the file loads: | |
<link rel="preload" href="mystyles.css" as="style" onload="this.rel='stylesheet'"> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment