Last active
August 29, 2015 14:20
-
-
Save alenabdula/2d814a8494bdfbaf2726 to your computer and use it in GitHub Desktop.
css-font-loading
This file contains hidden or 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
body { | |
font-family: sans-serif; | |
} | |
.helvetica-loaded body { | |
font-family: Helvetica, sans-serif; | |
} |
This file contains hidden or 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
var doc = document, | |
docEl = doc.documentElement; | |
doc.fonts.load("1em Helvetica") | |
.then(function () { | |
docEl.className += " helvetica-loaded"; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment