Skip to content

Commit 020f5a4

Browse files
CalinouBlendify
authored andcommitted
Use font-display: swap to ensure faster Web font display (#742)
See https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for more information.
1 parent 2a832ae commit 020f5a4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sass/_theme_font_local.sass

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,44 @@
44
src: url('../fonts/Lato/lato-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/Lato/lato-regular.woff2') format('woff2'), url('../fonts/Lato/lato-regular.woff') format('woff'), url('../fonts/Lato/lato-regular.ttf') format('truetype')
55
font-weight: 400
66
font-style: normal
7+
font-display: $font-display
78

89
@font-face
910
font-family: 'Lato'
1011
src: url('../fonts/Lato/lato-bold.eot')
1112
src: url('../fonts/Lato/lato-bold.eot?#iefix') format('embedded-opentype'), url('../fonts/Lato/lato-bold.woff2') format('woff2'), url('../fonts/Lato/lato-bold.woff') format('woff'), url('../fonts/Lato/lato-bold.ttf') format('truetype')
1213
font-weight: 700
1314
font-style: normal
14-
15+
font-display: $font-display
1516

1617
@font-face
1718
font-family: 'Lato'
1819
src: url('../fonts/Lato/lato-bolditalic.eot')
1920
src: url('../fonts/Lato/lato-bolditalic.eot?#iefix') format('embedded-opentype'), url('../fonts/Lato/lato-bolditalic.woff2') format('woff2'), url('../fonts/Lato/lato-bolditalic.woff') format('woff'), url('../fonts/Lato/lato-bolditalic.ttf') format('truetype')
2021
font-weight: 700
2122
font-style: italic
23+
font-display: $font-display
2224

2325
@font-face
2426
font-family: 'Lato'
2527
src: url('../fonts/Lato/lato-italic.eot')
2628
src: url('../fonts/Lato/lato-italic.eot?#iefix') format('embedded-opentype'), url('../fonts/Lato/lato-italic.woff2') format('woff2'), url('../fonts/Lato/lato-italic.woff') format('woff'), url('../fonts/Lato/lato-italic.ttf') format('truetype')
2729
font-weight: 400
2830
font-style: italic
31+
font-display: $font-display
2932

3033
@font-face
3134
font-family: 'Roboto Slab'
3235
font-style: normal
3336
font-weight: 400
3437
src: url('../fonts/RobotoSlab/roboto-slab.eot')
3538
src: url('../fonts/RobotoSlab/roboto-slab-v7-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/RobotoSlab/roboto-slab-v7-regular.woff2') format('woff2'), url('../fonts/RobotoSlab/roboto-slab-v7-regular.woff') format('woff'), url('../fonts/RobotoSlab/roboto-slab-v7-regular.ttf') format('truetype')
39+
font-display: $font-display
3640

3741
@font-face
3842
font-family: 'Roboto Slab'
3943
font-style: normal
4044
font-weight: 700
4145
src: url('../fonts/RobotoSlab/roboto-slab-v7-bold.eot')
4246
src: url('../fonts/RobotoSlab/roboto-slab-v7-bold.eot?#iefix') format('embedded-opentype'), url('../fonts/RobotoSlab/roboto-slab-v7-bold.woff2') format('woff2'), url('../fonts/RobotoSlab/roboto-slab-v7-bold.woff') format('woff'), url('../fonts/RobotoSlab/roboto-slab-v7-bold.ttf') format('truetype')
47+
font-display: $font-display

sass/_theme_variables.sass

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ $base-font-family: "Lato", "proxima-nova", "Helvetica Neue",
6565
$custom-font-family: "Roboto Slab", "ff-tisa-web-pro", "Georgia", Arial, sans-serif
6666
$custom-font-family2: Georgia, serif
6767
$code-font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace
68+
69+
$font-display: swap

0 commit comments

Comments
 (0)