Created
April 4, 2017 14:15
-
-
Save dbox/91797c4b1d37036fb03297d8280d811c to your computer and use it in GitHub Desktop.
Sample typekit embed
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
<!-- typekit --> | |
<script> | |
(function(d) { | |
var config = { | |
kitId: 'ldj3frj', | |
scriptTimeout: 3000, | |
async: true | |
}, | |
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s) | |
})(document); | |
</script> | |
// Fix FOUT | |
<style media="screen">.wf-loading {visibility: hidden;} .wf-active { visibility: visible; }</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! So helpful.