Created
October 5, 2018 13:56
-
-
Save plpepin/af6f0e985f451c9e6c67f3b1212ca899 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
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