perf: フォント preload 無効化とバッジコントラスト解消(Lighthouse 改善 第2弾)#17
Merged
Conversation
- next/font は日本語フォントを subset 指定できず全120スライス(2.1MB)を preload するため preload: false に。実際に描画するグリフのスライスだけが unicode-range 経由でロードされる - primary を oklch(0.55 0.17 38) に微調整し、ヒーローバッジの背景を bg-primary/5 に変更(バッジ 4.71:1 / ボタン白文字 5.15:1 で WCAG AA 達成) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
概要
PR #16 の続き。再計測で残った2つの原因への対処。
変更
preload: false— next/font は日本語フォントの subset 指定ができず、全120スライス(2.1MB)をrel=preloadで強制ダウンロードしていた(モバイル LCP 14.9s の主因)。無効化により、実際に描画するグリフのスライスだけが CSS の unicode-range 経由でロードされる。ビルド後 HTML からフォント preload が消えたことを確認済みbg-primary/10のバッジ背景も濃くなり 4.2:1 で唯一の未達に。primary をoklch(0.55 0.17 38)に微調整(視覚的にほぼ不変)+ バッジ背景をbg-primary/5に変更し、バッジ 4.71:1 / ボタン白文字 5.15:1 / ページ背景 5.05:1 で WCAG AA を余裕を持って達成(数値は WCAG 相対輝度で算出)検証
pnpm check/pnpm buildexit 0.next/server/app/index.htmlにフォントの preload リンクが 0 件🤖 Generated with Claude Code