mirror of
https://github.com/kremalicious/blog.git
synced 2025-02-14 21:10:25 +01:00
css-only Typekit loading
This commit is contained in:
parent
0eb35a4610
commit
df99f418f4
@ -32,6 +32,7 @@ body
|
|||||||
word-break: break-word
|
word-break: break-word
|
||||||
|
|
||||||
text-rendering: optimizeLegibility
|
text-rendering: optimizeLegibility
|
||||||
|
font-display: swap
|
||||||
// Controversial! But prevents text flickering in
|
// Controversial! But prevents text flickering in
|
||||||
// Safari/Firefox when animations are running
|
// Safari/Firefox when animations are running
|
||||||
-webkit-font-smoothing: antialiased
|
-webkit-font-smoothing: antialiased
|
||||||
@ -40,9 +41,6 @@ body
|
|||||||
|
|
||||||
letter-spacing: -.01em
|
letter-spacing: -.01em
|
||||||
|
|
||||||
.wf-active &
|
|
||||||
letter-spacing: normal
|
|
||||||
|
|
||||||
p,
|
p,
|
||||||
ul,
|
ul,
|
||||||
ol
|
ol
|
||||||
@ -72,10 +70,6 @@ h1, h2, h3, h4, h5, h6,
|
|||||||
font-weight: 500
|
font-weight: 500
|
||||||
letter-spacing: -.04em
|
letter-spacing: -.04em
|
||||||
|
|
||||||
.wf-active &
|
|
||||||
font-weight: $headings-font-weight
|
|
||||||
letter-spacing: normal
|
|
||||||
|
|
||||||
h1, .h1,
|
h1, .h1,
|
||||||
h2, .h2
|
h2, .h2
|
||||||
margin-top: ($spacer*2)
|
margin-top: ($spacer*2)
|
||||||
|
@ -63,21 +63,9 @@
|
|||||||
<meta name="robots" content="noindex,nofollow">
|
<meta name="robots" content="noindex,nofollow">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!--
|
<!-- TypeKit -->
|
||||||
TypeKit
|
<link rel="preload" href="https://use.typekit.net/msu4qap.css" as="style" crossorigin>
|
||||||
Improved snippet from https://blog.5apps.com/2014/02/21/using-typekit-the-right-way-with-an-improved-loading-script.html
|
<link rel="stylesheet" href="https://use.typekit.net/msu4qap.css">
|
||||||
-->
|
|
||||||
<script>
|
|
||||||
(function(d) {
|
|
||||||
var tkTimeout=3000;
|
|
||||||
if(window.sessionStorage){if(sessionStorage.getItem('useTypekit')==='false'){tkTimeout=0;}}
|
|
||||||
var config = {
|
|
||||||
kitId: 'msu4qap',
|
|
||||||
scriptTimeout: tkTimeout
|
|
||||||
},
|
|
||||||
h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+"wf-inactive";if(window.sessionStorage){sessionStorage.setItem("useTypekit","false")}},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+="wf-loading";tk.src='//use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
|
|
||||||
})(document);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Canonical URL -->
|
<!-- Canonical URL -->
|
||||||
<link rel="canonical" href="{{ site.url}}{{ page.url | replace:'index.html','' }}">
|
<link rel="canonical" href="{{ site.url}}{{ page.url | replace:'index.html','' }}">
|
||||||
|
Loading…
Reference in New Issue
Block a user