Skip to content

Instantly share code, notes, and snippets.

@xombra
Last active May 8, 2018 01:44
Show Gist options
  • Save xombra/f080eddfeda70be615c92ca9a0943e80 to your computer and use it in GitHub Desktop.
Save xombra/f080eddfeda70be615c92ca9a0943e80 to your computer and use it in GitHub Desktop.
Cargar font de google en forma asincronica
// Si son varias separar por comas
// en este ejemplo se carga la fuente "lato"
// debe colocarse en el head
// es para no usar
// <link href='https://fonts.googleapis.com/css?family=Lato:400,900,700' rel='stylesheet' type='text/css'>
<script type="text/javascript" async defer>
WebFontConfig={google:{families:['Lato:400,900,700']}};
(function(){var wf=document.createElement('script');
wf.src=('https:'==document.location.protocol ? 'https' : 'http') + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type='text/javascript';wf.async='true';
var s=document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf,s);})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment