Skip to content

Instantly share code, notes, and snippets.

@homosaur
Created December 13, 2012 15:46
Show Gist options
  • Save homosaur/4277303 to your computer and use it in GitHub Desktop.
Save homosaur/4277303 to your computer and use it in GitHub Desktop.
Load typekit via Modernizr, checks for fontface support (FOUC)
<script>
Modernizr.load([{
// Does the browser support @font-face?
test: Modernizr.fontface, // Should return a boolean
// Yep! Get the fonts
yep : 'http://use.typekit.com/.js',
complete: function() {
// Load complete! Tell Typekit to start up
try { Typekit.load(); } catch(e) {};
// Profit!
}
}]);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment