Commit 7722197
docs(design): kill FOUT via font-display: block + metric-matched fallbacks
Two-part fix to eliminate the visible font swap on page navigation:
1. font-display: block (was: swap)
Hides text up to 3s while the woff2 loads, then renders directly with
the web font. No fallback flashes mid-render. On cached navigations
the wait is imperceptible; on cold loads it's a brief invisible-text
moment instead of an obvious wrong-font flash.
2. Metric-matched local fallbacks
New "ABCArizonaFlare Fallback" / "ABCDiatype Fallback" /
"SuisseIntlMono Fallback" @font-face entries wrap Georgia / Trebuchet
MS / SFMono with size-adjust + ascent-override + descent-override so
the fallback occupies the exact same vertical and horizontal space as
the real font. If the block period expires before the woff2 arrives,
the fallback renders without layout shift, and the eventual swap is
visually invisible.
Metric values are starting estimates; tune by eye if any heading or body
line shifts when the swap happens.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 6528428 commit 7722197
1 file changed
Lines changed: 61 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
| 22 | + | |
| 23 | + | |
12 | 24 | | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
16 | 28 | | |
17 | | - | |
| 29 | + | |
18 | 30 | | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
25 | | - | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
32 | 44 | | |
33 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
34 | 65 | | |
35 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
36 | 88 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
40 | 94 | | |
41 | 95 | | |
42 | 96 | | |
| |||
0 commit comments