I AM LISTENING TO
|

WHAT I LIKE

Hiding NGFB errors in WordPress Admin Inherit and extend events from parent in Backbone
Development     Hosting     Javascript    

Optimizing Typekit font loading



5. May 2015

When loading web-fonts, we often see a brief un-styled moment before the browser applies the actual font. Gladly Typekit and also Google Web Fonts provide an option around that.

Both are using WebFont Loaders to help handle those brief moments.

TypeKit Webfont Loader Example

This adds a class name to the <html> element during loading

This is removed when loading is done. This allows us to hide content until all fonts are loaded.

Webfonts Loading

This also adds classes once the webfonts have been loaded, which allows us to add some transitions to reveal the content again.

Webfonts Loaded

One last thing. You should add the webfont loader early in your content, so that it can do its magic before anything else is being loaded.




Leave a Reply

Be the First to Comment!

Notify of
avatar