|
12 | 12 |
|
13 | 13 | /* UNIVERSAL FONTS */ |
14 | 14 | /****************************************************/ |
15 | | -/* Ignored for now, adding in head.html via google fonts. Can use this locally to optimize if needed */ |
16 | | - |
17 | | - |
18 | | -/* Lato font get from local fonts folder, not fonts.google.com as it loads facebook/youtube tracking data */ |
19 | | - /* Normal, Italic, Bold |
20 | | - 300, 400, 500 */ |
21 | | - |
22 | | -/* |
| 15 | +/* Lato font self-hosted from /fonts/ to avoid external requests and reduce CLS */ |
23 | 16 | @font-face { |
24 | 17 | font-family: 'Lato'; |
25 | 18 | font-style: normal; |
26 | 19 | font-weight: 300; |
27 | | - src: url('../fonts/LatoLatin-Light.woff2') format('woff2'), |
28 | | - url('../fonts/LatoLatin-Light.ttf') format('ttf'); |
29 | | - } |
30 | | - |
31 | | - @font-face { |
| 20 | + font-display: swap; |
| 21 | + src: url('/fonts/LatoLatin-Light.woff2') format('woff2'); |
| 22 | +} |
| 23 | +@font-face { |
32 | 24 | font-family: 'Lato'; |
33 | 25 | font-style: normal; |
34 | 26 | font-weight: 400; |
35 | | - src: url('../fonts/LatoLatin-Regular.woff2') format('woff2'), |
36 | | - url('../fonts/LatoLatin-Regular.ttf') format('ttf'); |
37 | | - } |
38 | | - |
39 | | - @font-face { |
40 | | - font-family: 'Lato'; |
41 | | - font-style: normal; |
42 | | - font-weight: 500; |
43 | | - src: url('../fonts/LatoLatin-Medium.woff2') format('woff2'), |
44 | | - url('../fonts/LatoLatin-Medium.ttf') format('ttf'); |
45 | | - } |
46 | | - |
| 27 | + font-display: swap; |
| 28 | + src: url('/fonts/LatoLatin-Regular.woff2') format('woff2'); |
| 29 | +} |
47 | 30 | @font-face { |
48 | 31 | font-family: 'Lato'; |
49 | 32 | font-style: italic; |
50 | 33 | font-weight: 300; |
51 | | - src: url('../fonts/LatoLatin-LightItalic.woff2') format('woff2'), |
52 | | - url('../fonts/LatoLatin-LightItalic.ttf') format('ttf'); |
53 | | - } |
54 | | - @font-face { |
| 34 | + font-display: swap; |
| 35 | + src: url('/fonts/LatoLatin-LightItalic.woff2') format('woff2'); |
| 36 | +} |
| 37 | +@font-face { |
55 | 38 | font-family: 'Lato'; |
56 | 39 | font-style: italic; |
57 | 40 | font-weight: 400; |
58 | | - src: url('../fonts/LatoLatin-Italic.woff2') format('woff2'), |
59 | | - url('../fonts/LatoLatin-Italic.ttf') format('ttf'); |
60 | | - } |
61 | | - @font-face { |
62 | | - font-family: 'Lato'; |
63 | | - font-style: italic; |
64 | | - font-weight: 500; |
65 | | - src: url('../fonts/LatoLatin-MediumItalic.woff2') format('woff2'), |
66 | | - url('../fonts/LatoLatin-MediumItalic.ttf') format('ttf'); |
67 | | - } |
68 | | -*/ |
| 41 | + font-display: swap; |
| 42 | + src: url('/fonts/LatoLatin-Italic.woff2') format('woff2'); |
| 43 | +} |
69 | 44 |
|
70 | 45 |
|
71 | 46 | /* UNIVERSAL */ |
@@ -183,17 +158,31 @@ table tbody td { |
183 | 158 |
|
184 | 159 |
|
185 | 160 |
|
| 161 | +/* CLS fix: reserve space for nav before hydration */ |
| 162 | +arm-top-navigation:not(:defined) { |
| 163 | + display: block; |
| 164 | + min-height: 80px; |
| 165 | +} |
| 166 | +@media (max-width: 1024px) { |
| 167 | + arm-top-navigation:not(:defined) { |
| 168 | + min-height: 60px; |
| 169 | + } |
| 170 | +} |
| 171 | + |
186 | 172 | /* Fix global nav height */ |
| 173 | +/* The arm-global-web-components script renders a position:fixed nav (0 flow space) |
| 174 | + and may inject a 50px sub-navigation bar in flow */ |
187 | 175 | /*************************************/ |
188 | 176 | #global-nav-height-fixer { |
189 | 177 | max-width: 100vw; |
190 | | - min-height: 80px; |
| 178 | + height: 80px; |
| 179 | + overflow: hidden; |
191 | 180 | position: relative; |
192 | 181 | top: 0; |
193 | 182 | } |
194 | 183 | @media (max-width: 1024px) { /* smaller screens than LG */ |
195 | 184 | #global-nav-height-fixer { |
196 | | - min-height: 60px; |
| 185 | + height: 60px; |
197 | 186 | } |
198 | 187 | } |
199 | 188 | .nav-transparent { |
@@ -453,3 +442,11 @@ html[theme='light'] body { |
453 | 442 | ads-masthead { --ads-masthead-horizontal-padding: 5px; } |
454 | 443 | } |
455 | 444 |
|
| 445 | +/* CLS fix: reserve space for arm-footer before hydration */ |
| 446 | +arm-footer-navigation:not(:defined) { |
| 447 | + display: block; |
| 448 | + min-height: 300px; |
| 449 | +} |
| 450 | +#arm-footer { |
| 451 | + contain: layout; |
| 452 | +} |
0 commit comments