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
|
||||
|
||||
text-rendering: optimizeLegibility
|
||||
font-display: swap
|
||||
// Controversial! But prevents text flickering in
|
||||
// Safari/Firefox when animations are running
|
||||
-webkit-font-smoothing: antialiased
|
||||
@ -40,9 +41,6 @@ body
|
||||
|
||||
letter-spacing: -.01em
|
||||
|
||||
.wf-active &
|
||||
letter-spacing: normal
|
||||
|
||||
p,
|
||||
ul,
|
||||
ol
|
||||
@ -72,10 +70,6 @@ h1, h2, h3, h4, h5, h6,
|
||||
font-weight: 500
|
||||
letter-spacing: -.04em
|
||||
|
||||
.wf-active &
|
||||
font-weight: $headings-font-weight
|
||||
letter-spacing: normal
|
||||
|
||||
h1, .h1,
|
||||
h2, .h2
|
||||
margin-top: ($spacer*2)
|
||||
|
@ -63,21 +63,9 @@
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
{% endif %}
|
||||
|
||||
<!--
|
||||
TypeKit
|
||||
Improved snippet from https://blog.5apps.com/2014/02/21/using-typekit-the-right-way-with-an-improved-loading-script.html
|
||||
-->
|
||||
<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>
|
||||
<!-- TypeKit -->
|
||||
<link rel="preload" href="https://use.typekit.net/msu4qap.css" as="style" crossorigin>
|
||||
<link rel="stylesheet" href="https://use.typekit.net/msu4qap.css">
|
||||
|
||||
<!-- Canonical URL -->
|
||||
<link rel="canonical" href="{{ site.url}}{{ page.url | replace:'index.html','' }}">
|
||||
|
Loading…
Reference in New Issue
Block a user