perf(docs): self-host Geist + preload + metric-matched fallback#14
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docsite/public/fonts/and preloading the 3 critical woff2 (Geist normal, Geist italic, Geist Mono normal) in__root.tsx.Geist Fallback/Geist Mono Fallback@font-facerules withsize-adjust+ascent-override/descent-overrideso the swap from system font → Geist is visually near-imperceptible (no CLS, no glyph jump).@import "@fontsource-variable/geist"(andgeist-mono) — they declared 5 unicode ranges per family, italic was missing so the hero's italic word was faux-synthesized.Test plan
pnpm buildsucceeds<link rel="preload" as="font" type="font/woff2" crossorigin="anonymous">and serves/fonts/*.woff2with200+font/woff2🤖 Generated with Claude Code