add 'Noto Sans Backtick Fix' alias to sans-serif font stacks - #1412
Merged
Conversation
🦋 Changeset detectedLatest commit: 0212a55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Design Token Diff (CSS)
|
Contributor
Design Token Diff (StyleLint)
|
Contributor
Design Token Diff (Fallbacks)
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Primer Primitives typography tokens to support a two-step rollout that avoids @font-face shadowing of system-installed Noto Sans by introducing a new alias family name in the sans-serif stacks.
Changes:
- Insert
'Noto Sans Backtick Fix'before'Noto Sans'infontStack.system. - Insert
'Noto Sans Backtick Fix'before'Noto Sans'infontStack.sansSerifandfontStack.sansSerifDisplay. - Add a Changeset to release the update as a minor version bump of
@primer/primitives.
Show a summary per file
| File | Description |
|---|---|
| src/tokens/functional/typography/font-stack.json5 | Adds the non-shadowing alias font family ahead of 'Noto Sans' in the three sans-serif stacks. |
| .changeset/noto-sans-backtick-fix-alias.md | Publishes the change as a minor release with a brief rationale and issue links. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Low
joshblack
approved these changes
Jul 30, 2026
Merged
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
Adds
'Noto Sans Backtick Fix'before'Noto Sans'infontStack.system,fontStack.sansSerif, andfontStack.sansSerifDisplay. This is step 1 of a two-step rollout withgithub/github-uito fix body text falling through to Helvetica/Arial/Nimbus on Linux Firefox (primer/css#3107, github/primer#6890).Root cause:
github/github-ui'shx_browsers.scssdeclares an@font-faceunder the family name'Noto Sans'that only coversU+60(backtick) as a workaround for a Noto Sans backtick rendering bug (github/primer#1531). Per CSS Fonts L4 §5.1, declaring an@font-faceunder'Noto Sans'shadows the system-installed Noto Sans for the whole page. Every non-backtick character then falls through the stack. On macOS/Windows this is invisible because-apple-system/'Segoe UI'wins earlier. On Linux Firefox there is no earlier match, so body text lands on Helvetica/Arial/Nimbus.The fix is to rename the
@font-faceinhx_browsers.scssto a non-shadowing name ('Noto Sans Backtick Fix') and reference that name in the stack before'Noto Sans'. That preserves the backtick workaround while letting'Noto Sans'resolve to the system font. This PR ships the stack change;github/github-uiwill ship the@font-facerename in step 2.What should reviewers focus on?
github/github-uirenames the@font-face. If the github-ui rename ships first, users on old Noto Sans versions would see zero-width backticks regress (github/primer#1531). At runtime, this PR is a no-op until step 2 lands: browsers try'Noto Sans Backtick Fix', find no matching face, and skip to'Noto Sans'exactly as today.--fontStack-system,--fontStack-sansSerif,--fontStack-sansSerifDisplay(and their equivalents in each output format, plus composite typography tokens that interpolate them). Any other diff is unexpected — please flag.Verification
To verify this PR resolves the underlying bug, I:
@font-faceinhx_browsers.scssfrom'Noto Sans'to'Noto Sans Backtick Fix'.@primer/primitivescanary version, so--fontStack-sansSerifincludes'Noto Sans Backtick Fix'before'Noto Sans'.-apple-system,BlinkMacSystemFont) from the computed stack, forcing the browser past the platform fallbacks.Before (current production page https://github.com/): the
'Noto Sans'@font-faceshadows the system Noto Sans, so every non-backtick character skips it and lands on Helvetica.After (this PR + github-ui#28664 — fix applied): the backtick face is now registered under
'Noto Sans Backtick Fix', so'Noto Sans'in the stack resolves to the system font and body text renders in Noto Sans as intended.Same page, same DOM, same computed
font-familyvalue — only the@font-facedeclaration and the stack alias differ.Related issues:
@font-faceworkaround)Contributor checklist: