forked from eoghanmurray/web-font-loading-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
async-data-uri.html
28 lines (26 loc) · 1.68 KB
/
async-data-uri.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Asynchronous Data URI</title>
<style>
body {
font-family: Lato, sans-serif;
}
</style>
<script>
/*! loadCSS: load a CSS file asynchronously. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */(function(e){"use strict";var t=function(t,n,r){function f(e){if(i.body)return e();setTimeout(function(){f(e)})}function c(){s.addEventListener&&s.removeEventListener("load",c),s.media=r||"all"}var i=e.document,s=i.createElement("link"),o;if(n)o=n;else{var u=(i.body||i.getElementsByTagName("head")[0]).childNodes;o=u[u.length-1]}var a=i.styleSheets;s.rel="stylesheet",s.href=t,s.media="only x",f(function(){o.parentNode.insertBefore(s,n?o:o.nextSibling)});var l=function(e){var t=s.href,n=a.length;while(n--)if(a[n].href===t)return e();setTimeout(function(){l(e)})};return s.addEventListener&&s.addEventListener("load",c),s.onloadcssdefined=l,l(c),s};typeof exports!="undefined"?exports.loadCSS=t:e.loadCSS=t})(typeof global!="undefined"?global:this);
loadCSS( "async-data-uri.css" );
</script>
</head>
<body>
<h1>Asynchronous Data URI</h1>
<p>This is a paragraph. <strong>This is heavier text.</strong> <em>This is emphasized text.</em> <strong><em>This is heavier and emphasized text.</em></strong></p>
<hr style="margin-top: 2em">
<ul>
<li>This demo is a companion to <a href="https://www.zachleat.com/web/comprehensive-webfonts/">A Comprehensive Guide to Font Loading Strategies</a></li>
<li>See all demos on <a href="https://github.com/zachleat/web-font-loading-recipes">GitHub <code>zachleat/web-font-loading-recipes</code></a></li>
</ul>
</body>
</html>