Show text before fonts are loaded. (#32)

Using `font-display: swap;` allows the browser to show the text
with another font before the webfonts are loaded. This makes the
loading time feel faster as you can already start reading instead
of looking at an empty website till the fonts are loaded.
See: https://fontsplugin.com/google-fonts-font-display-swap/
This commit is contained in:
Martin
2019-11-27 16:57:13 +01:00
committed by Carson Ip
parent 70c973528e
commit 27d1950183
3 changed files with 15 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(fonts/mrl8jkM18OlOQN8JLgasDy2Q8seG17bfDXYR_jUsrzg.woff2) format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
@@ -11,6 +12,7 @@
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
font-display: swap;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url(fonts/mrl8jkM18OlOQN8JLgasD9V_2ngZ8dMf8fLgjYEouxg.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}