fix(ui): render Geist consistently across Firefox and Chrome#2842
fix(ui): render Geist consistently across Firefox and Chrome#2842birkskyum wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThis pull request adds an experimental configuration flag to the Nuxt config file to disable local font fallbacks. The flag is inserted within the font configuration section and targets Firefox font rendering compatibility. ChangesFont configuration experimental flag
Possibly related PRs
Suggested reviewers
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hello! Thank you for opening your first PR to npmx, @birkskyum! 🚀 Here’s what will happen next:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Previously, nuxt loaded fonts from the internet during build time, and in my PR, we changed it to use fonts stored in our repository. This PR changes what nuxt-fonts generates - it no longer uses fonts already installed on the user's system, but always loads them from our assets. On the one hand, we guarantee that the font will be exactly what we want, but on the other, it will depend only on our assets. Perhaps there's something else going on. In general, I think fontFallback is about a fallback font (like in nuxt/fontaine), not a priority font (as it is in nuxt/fonts). It seems like there might be an issue in the module itself. @danielroe wdyt? On Windows everything seems to work without problems Otherwise lgtm |
🔗 Linked issue
resolves #2841
🧭 Context
Firefox on macOS renders the site's header text (logo, nav, "jump to..." button) noticeably thinner than Chrome. Reproducible on any machine with Geist or Geist Mono installed in
~/Library/Fonts/, which is pretty common since Vercel ships them with their dev tools.The cause is the
local()fallbacks in the auto-generated@font-facerules:Chrome 86+ ignores
local()for user-installed fonts as an anti-fingerprinting measure, so it falls through to the bundled TTF. Firefox honours it and picks up the local OTF. Same Geist family, but the OTF (CFF outlines) and TTF (TrueType outlines) rasterize differently in Firefox on macOS, and the OTF ends up lighter. Identical CSS, two different fonts actually rendered.📚 Description
Sets
fonts.experimental.disableLocalFallbacks: trueinnuxt.config.ts. With it on,@nuxt/fontsstops emittinglocal(...)in the generatednuxt-fonts-global.css, so both browsers always load the bundled TTFs frompublic/fonts/.Verified by checking the generated CSS no longer contains
local(...)entries and that Firefox now matches Chrome after a hard reload.Before ( macos w/ firefox ) - npmx.dev

After ( macos w/ firefox ) - localhost
