Skip to content

v6: Ship Inter and JetBrains Mono as the default fonts#4426

Closed
trevor-scheer wants to merge 3 commits into
graphiql-6from
trevor/font-system
Closed

v6: Ship Inter and JetBrains Mono as the default fonts#4426
trevor-scheer wants to merge 3 commits into
graphiql-6from
trevor/font-system

Conversation

@trevor-scheer

Copy link
Copy Markdown
Contributor

Summary

  • v6 now ships Inter and JetBrains Mono by default, matching the original design handoff. tokens.css already declared --font-family: 'Inter' and --font-family-mono: 'JetBrains Mono', but nothing actually loaded those fonts, and a legacy block in root.css redeclared both vars with the old Roboto/Fira Code values and won the cascade. So the app had actually been rendering Roboto and Fira Code this whole time regardless of what the tokens said.
  • Self-hosted font/inter.css and font/jetbrains-mono.css (base64, Latin + Latin Extended, regular and italic) load by default now, following the same pattern as the existing font/roboto.css / font/fira-code.css. Roboto and Fira Code stay in the repo and stay importable for anyone who wants the v5 look.
  • Removed the --font-family, --font-family-mono, and --font-size-body redeclarations from root.css's .graphiql-container block so tokens.css actually wins. That also fixes a second bug: --font-size-body was pinned to a fixed 15px by the same shadowing, so the Settings > Font Size preset never touched body text. It scales correctly now.
  • Monaco's editor font is now JetBrains Mono instead of Fira Code, matching the token.
  • Bundle impact: the two self-hosted font files add about 160 KB to graphiql's built style.css (710 KB → 875 KB) compared to today's Roboto + Fira Code. That's the cost of matching the handoff exactly; happy to trim further (e.g. drop italic, which is most of the added weight) if the size isn't worth it.

Test plan

  • Open the app. The UI (panel headers, buttons, sidebar) should render in Inter, and the query/response editors should render in JetBrains Mono, not Roboto/Fira Code.
  • Open Settings and change Font Size to Large or Extra Large. Body text throughout the app should visibly grow (it previously stayed fixed regardless of this setting).
  • Set Font Size back to Default and confirm everything returns to its original size.
  • Check both Dark and Light themes look right at a couple of font sizes.
  • Type a query with a # comment and confirm it renders in italic in the editor.

Refs: #4228

Self-host Inter and JetBrains Mono (Latin + Latin Extended, regular and
italic) as base64 `font/inter.css` / `font/jetbrains-mono.css`, matching
the existing `roboto.css` / `fira-code.css` pattern. `graphiql`'s
`style.css` now imports these instead, so `tokens.css`'s existing
`--font-family: 'Inter'` / `--font-family-mono: 'JetBrains Mono'` values
actually resolve to a loaded font instead of falling through to the
system default. Roboto and Fira Code stay in the repo for v5 lineage.
.graphiql-container redeclared --font-family, --font-family-mono, and
--font-size-body with frozen v5 values, which won the cascade over
tokens.css's :root declarations. That's why the app was actually
rendering Roboto/Fira Code regardless of the tokens, and why
--font-size-body never scaled with the font-size preset. Dropping the
redeclarations lets tokens.css win; the --color-*/--alpha-* frozen
values in this block are untouched.
Matches --font-family-mono now that JetBrains Mono is what actually
loads by default.
@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8b130d4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@trevor-scheer

Copy link
Copy Markdown
Contributor Author

Deciding against.

trevor-scheer added a commit that referenced this pull request Jul 15, 2026
…4428)

## Summary

`tokens.css` declared `--font-family: 'Inter'` and `--font-family-mono:
'JetBrains Mono'`, but nothing in the app ever rendered in either.
`root.css` redeclared both variables on `.graphiql-container`, pointing
them back at Roboto and Fira Code, and that selector beats `:root` in
the cascade. `packages/graphiql/src/style.css` only ever `@import`s the
Roboto and Fira Code `@font-face` files, so Inter and JetBrains Mono
weren't loaded to begin with — even if the cascade had gone the other
way, the browser would have fallen through to the generic fallbacks.

We decided in #4426 to keep Roboto and Fira Code rather than swap the
type system, so this points the canonical declaration in `tokens.css` at
the fonts that actually ship and drops the now-redundant
`.graphiql-container` override. One declaration, and it matches what you
see. No font loading changes.

## Test plan

- [x] Open the app and inspect the query editor and any body text.
Computed `font-family` resolves to Fira Code and Roboto respectively,
same as before this change.
- [x] In DevTools, confirm `--font-family` on `.graphiql-container` now
inherits from `:root` rather than being overridden locally, and that its
value is Roboto.
- [x] Switch themes and density presets and confirm no type regressions
anywhere in the app (top bar, status bar, doc explorer, history,
response pane).

Refs: #4219
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant