Skip to content

Commit 1b01a86

Browse files
atiq-csdaveaglick
authored andcommitted
Utilize Google Fonts v2 API with optimized variable fonts, provide fallback when
var font support is not available Variable fonts are optimized in size refs, - https://developers.google.com/fonts/docs/css2
1 parent 6768cf9 commit 1b01a86

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

input/_layout.cshtml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,33 @@
5050

5151
<!-- Custom fonts for this template -->
5252
<link href='@Context.GetLink("/vendor/fontawesome-free/css/all.min.css")' rel="stylesheet">
53-
<link href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" rel="stylesheet" data-no-mirror>
54-
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" rel="stylesheet" data-no-mirror>
53+
<link href="https://fonts.googleapis.com/css2?family=Lora:wght@400..700&display=swap" rel="stylesheet" data-no-mirror>
54+
<link href="https://fonts.googleapis.com/css2?family=Lora:ital,wght@1,400..700&display=swap" rel="stylesheet" data-no-mirror>
55+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400..700&display=swap" rel="stylesheet" data-no-mirror>
56+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@1,400..700&display=swap" rel="stylesheet" data-no-mirror>
57+
<style>
58+
* {
59+
font-family: 'Lora';
60+
font-weight: 400;
61+
}
62+
@@supports (font-variation-settings: "wght" 500) {
63+
* {
64+
font-family: 'Lora';
65+
font-weight: 500;
66+
}
67+
}
68+
69+
* {
70+
font-family: 'Open Sans';
71+
font-weight: 400;
72+
}
73+
@@supports (font-variation-settings: "wght" 500) {
74+
* {
75+
font-family: 'Open Sans';
76+
font-weight: 500;
77+
}
78+
}
79+
</style>
5580

5681
<!-- Styles for this template (also includes Bootstrap) -->
5782
<link href='@Context.GetLink("/scss/clean-blog.css")' rel="stylesheet">

0 commit comments

Comments
 (0)