Created
December 13, 2012 15:46
-
-
Save homosaur/4277303 to your computer and use it in GitHub Desktop.
Load typekit via Modernizr, checks for fontface support (FOUC)
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
<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