Skip to content

perf(docs): self-host Geist + preload + metric-matched fallback#14

Merged
rqbazan merged 1 commit into
mainfrom
perf/docsite-fonts
May 20, 2026
Merged

perf(docs): self-host Geist + preload + metric-matched fallback#14
rqbazan merged 1 commit into
mainfrom
perf/docsite-fonts

Conversation

@rqbazan
Copy link
Copy Markdown
Member

@rqbazan rqbazan commented May 20, 2026

Summary

  • Eliminates the ~1s FOUT on the landing by self-hosting a latin-only Geist subset under docsite/public/fonts/ and preloading the 3 critical woff2 (Geist normal, Geist italic, Geist Mono normal) in __root.tsx.
  • Adds Geist Fallback / Geist Mono Fallback @font-face rules with size-adjust + ascent-override / descent-override so the swap from system font → Geist is visually near-imperceptible (no CLS, no glyph jump).
  • Drops @import "@fontsource-variable/geist" (and geist-mono) — they declared 5 unicode ranges per family, italic was missing so the hero's italic word was faux-synthesized.

Test plan

  • pnpm build succeeds
  • Dev server emits the 3 <link rel="preload" as="font" type="font/woff2" crossorigin="anonymous"> and serves /fonts/*.woff2 with 200 + font/woff2
  • Visual check in browser: DevTools → Network filtered by "font" should show all 3 woff2 with Priority "Highest" and finishing before first paint

🤖 Generated with Claude Code

Eliminates the ~1s FOUT on the landing. Drops the broad
@fontsource @import (5 unicode ranges per family) in favor of a
latin-only self-hosted subset served from /fonts/, preloads the
3 critical woff2 above the fold, and adds Geist/Geist-Mono
fallback @font-face declarations with size-adjust + ascent/descent
overrides so the swap is visually near-imperceptible. Also adds the
italic face that was previously being faux-synthesized.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rqbazan rqbazan merged commit 4888f31 into main May 20, 2026
4 checks passed
@rqbazan rqbazan deleted the perf/docsite-fonts branch May 20, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant