Repository navigation
reduce text layout shifting - #437
Merged
Merged
Conversation
…ut shift Fonts were loaded from fontsource's CSS with font-display: swap, so text was laid out in a system fallback first and reflowed when each font arrived. - Declare all @font-face rules in src/lib/fonts/fonts.css, loaded as its own stylesheet so its hash only changes when the fonts do. - Inline the five latin files every page uses (Inter 400/600/700, JetBrains Mono 400, Monument Extended Black) as data URIs via assetsInlineLimit, so they arrive with render-blocking CSS. Other subsets stay as regular files. - Add metric-matched local fallbacks (Arial, Arial Bold, Courier New, Arial Black) with size-adjust/ascent/descent overrides computed from the font files, so the brief pre-decode fallback takes the same space. - Use --font-sans/--font-mono/--font-display variables for every font-family declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
deployed preview: https://comma-web--pr437-8fu73ihg.web.appWelcome! Make sure to:
|
Keep the separate fonts stylesheet with the inlined core fonts; remove the fallback @font-face rules and the font-family variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rules were copied to change font-display, which no longer matters now that the fonts are inlined; assetsInlineLimit inlines them from fontsource's CSS too. Co-Authored-By: Claude Opus 5.5 <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.
No description provided.