Skip to content

Instantly share code, notes, and snippets.

@villian
Forked from paulozoom/index.html
Created February 18, 2021 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save villian/24bc5bd724b6c904dc15bee04fd1e9c3 to your computer and use it in GitHub Desktop.
Save villian/24bc5bd724b6c904dc15bee04fd1e9c3 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