Skip to content

fix(fonts): self-host Inter and drop the unused Roboto Mono link - #834

Merged
ECWireless merged 1 commit into
mainfrom
fix-font-loading
Oct 9, 2026
Merged

ECWireless merged 1 commit into
mainfrom
fix-font-loading

Conversation

@thebeyondr

@thebeyondr thebeyondr commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Inter is the design system's body font ($body: "Inter, -apple-system, system-ui, sans-serif"), but it was loaded from Google Fonts with display=optional: on a slow first load the browser keeps the system-ui fallback for the entire page view, so the brand font often never renders. Separately, every page fetched a Roboto Mono stylesheet that no design token references ($mono is Söhne Mono, menlo), so it was pure waste.

Why Fontsource instead of Google Fonts

  • No third-party render path. The Google Fonts CSS + font files cost two extra origins (DNS/TLS to fonts.googleapis.com and fonts.gstatic.com) in the critical path, and the request leaks visitor IPs to Google, a recurring GDPR complaint for public explorers.
  • Pinned and reproducible. Font files are versioned in the lockfile like any other dependency. Google's served CSS/files can change under the same URL.
  • No network dependency at build or runtime. Works offline and in locked-down CI. (next/font/google was the alternative, but it downloads from Google at build time; Fontsource avoids that entirely.)
  • Ships only what's used. Latin subset, weights 400-700. The old link requested 400-900; nothing in the repo uses 800/900.
  • Fontsource CSS uses font-display: swap, so the display=optional permanent-fallback behavior is gone.

Type of Change

  • fix: Bug fix
  • perf: Performance improvement

Related Issue

n/a. Spotted while reviewing Explorer typography for #802 design work.

Changes Made

  • Load Inter from @fontsource/inter (latin 400-700, the only weights used in the repo; nothing uses 800/900) in pages/_app.tsx
  • Remove both Google Fonts <link> tags from pages/_document.tsx
  • No token or globalStyles changes needed: $body already names Inter first, and Fontsource's family name matches

Testing

  • Tested locally (pnpm typecheck and pnpm lint clean)
  • Added/updated tests
  • All tests passing

Production build left to CI; local WSL environment can't sustain a full next build.

Screenshots (if applicable)

n/a. No visual change when Inter was already rendering; fixes the cases where it silently wasn't.

Checklist

  • My commits are signed (verified)
  • My commit messages follow Conventional Commits format
  • My branch name follows the naming convention
  • My code follows the project's code style
  • I have commented my code where necessary

Additional Notes

$untitled (Untitled Sans) and $mono (Söhne Mono) still reference Klim fonts that are never loaded anywhere, so they silently fall back to system fonts. Fixing that means either shipping licensed files or changing the tokens in @livepeer/design-system; out of scope here.

Inter was loaded from Google Fonts with display=optional, so on a slow
first load the browser kept the system-ui fallback for the entire page
view and the brand font never appeared. Roboto Mono was fetched on every
page but no design token references it ($mono is Söhne Mono, menlo), so
the request was pure waste.

Load Inter from @fontsource/inter instead (latin 400-700, the only
weights in use). The design system's $body token already names Inter
first, so no token or globalStyles change is needed, and the
third-party render-blocking stylesheet request goes away.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 00:33
@thebeyondr
thebeyondr requested a review from ECWireless as a code owner October 8, 2026 00:33
@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
explorer-arbitrum-one Ready Ready Preview Oct 8, 2026 12:34am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The font imports, dependency metadata, and removal of obsolete external resources are consistent and complete.

0 open findings

What changed in this PR

Self-hosts Inter to ensure consistent typography while removing unused external font requests.

Changes:

  • Adds Fontsource Inter weights 400–700 globally.
  • Removes Google Fonts links for Inter and Roboto Mono.
  • Adds and locks the Fontsource dependency.
File Description
pages/​_app.tsx Imports self-hosted Inter styles.
pages/​_document.tsx Removes external font stylesheets.
package.json Adds Fontsource Inter dependency.
pnpm-lock.yaml Locks the new dependency.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@thebeyondr thebeyondr self-assigned this Oct 8, 2026
@ECWireless
ECWireless merged commit 169ac65 into main Oct 9, 2026
7 checks passed
@ECWireless
ECWireless deleted the fix-font-loading branch October 9, 2026 02:32

This branch was successfully deployed

1 active deployment
Preview — ba18ef45 Deployed Oct 8, 2026 by vercel[bot]
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.

4 participants