Skip to content

Instantly share code, notes, and snippets.

@paulozoom
Last active February 18, 2021 23:33
Show Gist options
  • Save paulozoom/8b4eb39512ca273e8a8e7deb7e305e84 to your computer and use it in GitHub Desktop.
Save paulozoom/8b4eb39512ca273e8a8e7deb7e305e84 to your computer and use it in GitHub Desktop.
Async non-render-blocking loading of cloud.Typography’s typefaces
<!-- loadCSS with async -->
<script async="async" src="/assets/loadcss.js" type="text/javascript"></script>
<!-- preload the fonts -->
<link as="style" href="https://cloud.typography.com/[…].css" onload="this.rel='stylesheet'" rel="preload" />
<!-- non-JS fallback -->
<noscript>
<link href="https://cloud.typography.com/[…].css" media="screen" rel="stylesheet" type="text/css" />
</noscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment