Skip to content

Instantly share code, notes, and snippets.

@plpepin
Created October 5, 2018 13:56
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 plpepin/af6f0e985f451c9e6c67f3b1212ca899 to your computer and use it in GitHub Desktop.
Save plpepin/af6f0e985f451c9e6c67f3b1212ca899 to your computer and use it in GitHub Desktop.
Preload Bold version of font alternatives
- When template system uses a cache buster (say Shopify liquid)
<link href="{{ 'maisonneue-demi-webfont.woff2' | asset_url | split: "?" | first }}" type="font/woff2" as="font" rel="preload" />
- When the above doesnt work because the a javascript initiated the download even if the file is downloaded already
CSS:
.predload-maison-bold {
font-weight: bold;
}
HTML:
...
<span class="predload-maison-bold"></span>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment