-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds
font-display: optional
strategies
- Loading branch information
Showing
3 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>preload and font-display: optional</title> | ||
<link rel="preload" href="font-lato/lato-regular-webfont.woff2" as="font" type="font/woff2" crossorigin> | ||
<link rel="preload" href="font-lato/lato-bold-webfont.woff2" as="font" type="font/woff2" crossorigin> | ||
<link rel="preload" href="font-lato/lato-italic-webfont.woff2" as="font" type="font/woff2" crossorigin> | ||
<link rel="preload" href="font-lato/lato-bolditalic-webfont.woff2" as="font" type="font/woff2" crossorigin> | ||
<style> | ||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-regular-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-regular-webfont.woff') format('woff'); | ||
font-display: optional; | ||
} | ||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-bold-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-bold-webfont.woff') format('woff'); | ||
font-weight: 700; | ||
font-display: optional; | ||
} | ||
|
||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-italic-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-italic-webfont.woff') format('woff'); | ||
font-style: italic; | ||
font-display: optional; | ||
} | ||
|
||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-bolditalic-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-bolditalic-webfont.woff') format('woff'); | ||
font-weight: 700; | ||
font-style: italic; | ||
font-display: optional; | ||
} | ||
body { | ||
font-family: Lato, sans-serif; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>font-display: optional</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> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>font-display: optional</title> | ||
<style> | ||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-regular-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-regular-webfont.woff') format('woff'); | ||
font-display: optional; | ||
} | ||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-bold-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-bold-webfont.woff') format('woff'); | ||
font-weight: 700; | ||
font-display: optional; | ||
} | ||
|
||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-italic-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-italic-webfont.woff') format('woff'); | ||
font-style: italic; | ||
font-display: optional; | ||
} | ||
|
||
@font-face { | ||
font-family: Lato; | ||
src: url('font-lato/lato-bolditalic-webfont.woff2') format('woff2'), | ||
url('font-lato/lato-bolditalic-webfont.woff') format('woff'); | ||
font-weight: 700; | ||
font-style: italic; | ||
font-display: optional; | ||
} | ||
body { | ||
font-family: Lato, sans-serif; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>font-display: optional</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> |