Skip to content

Commit ddf67fa

Browse files
committed
try to fix mobile cls
1 parent e29d9d9 commit ddf67fa

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

_data/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ brochures-icon: fas fa-info-circle fa-2x #default: fas fa-plus fa-3x
1010

1111
# Add custom fonts
1212
fonts_urls:
13-
- "https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Droid+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap"
13+
- "https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Droid+Serif:ital,wght@0,400;0,700;1,400;1,700&display=optional"
1414

1515
# Set custom fonts
1616
fonts:

_includes/layout/head.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,25 @@
4242
causing the 0.538 CLS. Keeping it absolute from the start prevents that shift. */
4343
#meshNetwork { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; pointer-events: none; }
4444
@media (min-width: 768px) { #meshNetwork { display: block; } }
45+
/* Font metric overrides: make Arial/Georgia match Montserrat/DroidSerif metrics so
46+
fallback→web-font swap causes no visible layout shift (CLS). Values from fontpie/
47+
@next/font calculations for Montserrat Regular vs Arial. */
48+
@font-face {
49+
font-family: "MontserratFallback";
50+
src: local("Arial"), local("Helvetica Neue");
51+
size-adjust: 113.48%;
52+
ascent-override: 84.56%;
53+
descent-override: 21.99%;
54+
line-gap-override: 0%;
55+
}
56+
@font-face {
57+
font-family: "DroidSerifFallback";
58+
src: local("Georgia"), local("Times New Roman");
59+
size-adjust: 97.3%;
60+
ascent-override: 106.9%;
61+
descent-override: 29.3%;
62+
line-gap-override: 0%;
63+
}
4564
</style>
4665

4766
{% if site.analytics.google %}

_sass/base/_mixins.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Font Mixins
22
@mixin serif-font {
3-
font-family: "Droid Serif", $font-fallback;
3+
font-family: "Droid Serif", "DroidSerifFallback", $font-fallback;
44
}
55

66
@mixin body-font {
77
font-family: $font-fallback;
88
}
99

1010
@mixin heading-font {
11-
font-family: "Montserrat", $font-fallback;
11+
font-family: "Montserrat", "MontserratFallback", $font-fallback;
1212
}
1313

1414
// Layout & section mixins

_sass/layout/_references.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
img {
108108
max-height: 80px;
109109
width: auto;
110+
aspect-ratio: 4 / 1;
110111
transition: filter 0.35s ease, transform 0.35s ease;
111112
filter: grayscale(15%) brightness(1.05);
112113
}

0 commit comments

Comments
 (0)