Repository navigation
[docs-infra] Use font variables on body - #49460
Merged
Merged
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
Janpot
marked this pull request as ready for review
October 14, 2026 09:25
brijeshb42
approved these changes
Oct 14, 2026
Member
|
Thanks for following up on this. 🙏 Codex insightsOptional follow-up: the docs body now uses CssBaseline's system fallback stack instead of Next's metric-adjusted IBM Plex Sans fallback. Loaded typography is preserved, but loading-time layout behavior could differ. Consuming the font variables in the theme could restore the adjusted fallback; CLS was not measured in this review. The linked Next.js #88894 is a separate font-family naming mismatch to account for when consuming those variables. |
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.
Follow-up to #49455. Put the
next/font.variableclasses on<body>instead of the.classNameclasses, and drop the special case for General Sans.A
next/fontclassNamesetsfont-family, and for loaders with a single file alsofont-weightandfont-style. Placing those classes on<body>let them override CssBaseline (they are unlayered, CssBaseline is in@layer mui), which is how General Sans 600 leaked into body text. Any future single-file loader would bring that back. The docs never rely on these classes: the themes reference the fonts by family name, and the_appre-export is what puts the font CSS in the bundle. A.variableclass only defines a custom property, so it can't change rendering in either bundler.What changes on the page: body text now takes its font from CssBaseline instead of whichever font class came last in the stylesheet. On docs pages that is the same IBM Plex Sans. The full page templates now get the body font from their own theme as intended. Internal
/performanceand/experimentspages render no CssBaseline, so plain text there falls back to the browser default font.The variables (
--font-ibm-plex-sans,--font-general-sans,--font-inter,--font-roboto) are not consumed yet. They point at the… Fallbackfaces Next generates with matched metrics, which the theme could use to reduce layout shift while fonts load. Under Turbopack the variable values use the JS binding name instead of the declared family (vercel/next.js#88894), so a theme change should list the family name first, for example"General Sans", var(--font-general-sans), ….