Skip to content

feat: update default font from CentraNo1 to Geist - #210

Merged
georgewrmarshall merged 2 commits into
mainfrom
update-font-centrano1-to-geist
Mar 18, 2026
Merged

feat: update default font from CentraNo1 to Geist#210
georgewrmarshall merged 2 commits into
mainfrom
update-font-centrano1-to-geist

Conversation

@georgewrmarshall

@georgewrmarshall georgewrmarshall commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Update default font from CentraNo1 to Geist, aligning with @metamask/design-tokens v8 (migration guide)
  • Replace CentraNo1 .woff2 files with 6 Geist .woff2 font faces (Regular, RegularItalic, Medium, MediumItalic, Bold, BoldItalic) sourced from metamask-design-system/apps/storybook-react
  • Update @font-face declarations in index.css to match the design system's storybook-react conventions

Before

Screenshot 2026-03-17 at 4 17 02 PM

After

Screenshot 2026-03-17 at 4 15 40 PM

Changes

File Change
package.json @metamask/design-tokens: ^7.1.0^8.0.0
static/index.css 3 CentraNo1 @font-face → 6 Geist @font-face blocks
static/fonts/ Remove CentraNo1-{Book,Medium,Bold}.woff2
static/fonts/Geist/ Add Geist-{Regular,RegularItalic,Medium,MediumItalic,Bold,BoldItalic}.woff2
yarn.lock Updated (design-tokens resolved to 8.2.2)

design-tokens v7 → v8 breaking changes review

Per the migration guide, v8 has three breaking changes:

  1. Font family change (CentraNo1 → Geist) — ✅ Handled by this PR
  2. background/muted now transparent — ✅ Not applicable (this codebase uses background-alternative and background-default only)
  3. HeadingSMRegular tokens removed — ✅ Not applicable (not used in this codebase)

Verification

  • yarn lint passes
  • yarn build succeeds
  • --font-family-default resolves to 'Geist', 'Helvetica Neue', Helvetica, Arial, sans-serif
  • No references to CentraNo1 remain in the codebase
  • Visual verification (needs Playwright browsers installed or manual check)

Note

Medium Risk
Upgrades @metamask/design-tokens to a new major version and changes font assets/CSS, which could cause subtle visual regressions if token expectations differ.

Overview
Updates the project to @metamask/design-tokens v8 and aligns typography with the design system by switching the bundled default font from CentraNo1 to Geist.

Replaces the existing CentraNo1 @font-face declarations with a fuller Geist set (regular/medium/bold, plus italics) and updates yarn.lock to resolve design-tokens to v8.x.

Written by Cursor Bugbot for commit 28f9f8a. This will update automatically on new commits. Configure here.

Replace CentraNo1 font with Geist to align with the design-tokens v8
font family migration (metamask-design-system). This matches the
@font-face declarations used in the design system's storybook-react.

- Update @metamask/design-tokens from ^7.1.0 to ^8.0.0
- Replace CentraNo1 woff2 files with Geist woff2 files (6 faces:
  Regular, RegularItalic, Medium, MediumItalic, Bold, BoldItalic)
- Update @font-face declarations in index.css
@socket-security

socket-security Bot commented Mar 17, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​design-tokens@​7.1.0 ⏵ 8.2.2100 +110010096 +9100

View full report

Comment thread package.json
},
"dependencies": {
"@metamask/design-tokens": "^7.1.0",
"@metamask/design-tokens": "^8.0.0",

@georgewrmarshall georgewrmarshall Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@metamask/design-tokens v8 introduces 3 breaking changes (migration guide): (1) font family CentraNo1→Geist, (2) background/muted now transparent, (3) HeadingSMRegular tokens removed. Only (1) applies here — this codebase uses background-alternative and background-default only, and no HeadingSMRegular tokens. The build copies @metamask/design-tokens/styles.css into design-tokens.css at build time, so the --font-family-default CSS variable automatically resolves to Geist after this upgrade.

Comment thread static/index.css
font-family: 'Geist';
font-style: normal;
font-weight: 400;
src: url('fonts/Geist/Geist-Regular.woff2') format('woff2');

@georgewrmarshall georgewrmarshall Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The old CentraNo1 declarations only covered normal style (Book/Medium/Bold). These Geist declarations add italic variants for each weight (Regular, Medium, Bold), matching the canonical font set from metamask-design-system/apps/storybook-react/fonts/Geist. This ensures any future use of font-style: italic in this page renders correctly with the bundled font rather than relying on browser faux-italic synthesis.

Comment thread static/index.css

body {
background-color: var(--color-background-alternative);
background-color: var(--color-background-default);

@georgewrmarshall georgewrmarshall Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This aligns the page background with the design system's primary surface color. In the dark theme context (data-theme="dark" on <html>), --color-background-default produces the standard dark surface, consistent with how the extension renders full-page views.

Comment thread static/index.css
border: 1px solid var(--color-primary-default);
color: var(--color-icon-inverse);
background: var(--color-icon-default);
border: 1px solid var(--color-icon-default);

@georgewrmarshall georgewrmarshall Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This aligns the primary button with the design system's Button component which uses icon-based tokens for its primary variant. The previous --color-primary-default (blue) styling was from an older design iteration. The icon-based tokens produce a dark button with light text in the dark theme — matching the extension's current button appearance. This also removes the need for the data-theme="light" override that was previously on this button in index.html.

Comment thread static/index.html

<div class="button-container">
<button class="button-primary" id="portfolio-link" data-theme="light">
<button class="button-primary" id="portfolio-link">

@georgewrmarshall georgewrmarshall Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This button previously forced a light-theme context on itself to get the desired blue-on-white appearance from --color-primary-* tokens. With the token migration to --color-icon-*, the button now renders correctly under the page's native data-theme="dark" context (set on <html>), making the per-element theme override unnecessary.

Comment thread static/index.css
background-color: var(--color-primary-default);
color: var(--color-icon-inverse);
background-color: var(--color-icon-default-hover);
border-color: var(--color-icon-default-hover);

@georgewrmarshall georgewrmarshall Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The old hover state kept background-color: var(--color-primary-default) — identical to the default state, meaning no visible hover feedback. The new tokens (--color-icon-default-hover, --color-icon-default-pressed) provide distinct visual states. Also adds border-color tracking on hover, which was previously missing — the border would stay the default color while the background changed, causing a visual mismatch.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Button hover/active uses likely non-existent design tokens
    • Replaced undefined hover/pressed icon tokens with existing --color-icon-default for background and border to prevent disappearance.

Create PR

Or push these changes by commenting:

@cursor push 46dcb0c0c9
Preview (46dcb0c0c9)
diff --git a/static/index.css b/static/index.css
--- a/static/index.css
+++ b/static/index.css
@@ -133,14 +133,14 @@
 
 .button-primary:hover {
   color: var(--color-icon-inverse);
-  background-color: var(--color-icon-default-hover);
-  border-color: var(--color-icon-default-hover);
+  background-color: var(--color-icon-default);
+  border-color: var(--color-icon-default);
 }
 
 .button-primary:active {
   color: var(--color-icon-inverse);
-  background-color: var(--color-icon-default-pressed);
-  border-color: var(--color-icon-default-pressed);
+  background-color: var(--color-icon-default);
+  border-color: var(--color-icon-default);
 }
 
 .button-link-danger {

Comment thread static/index.css
@georgewrmarshall
georgewrmarshall marked this pull request as ready for review March 17, 2026 23:26
@georgewrmarshall
georgewrmarshall requested a review from a team as a code owner March 17, 2026 23:26
@georgewrmarshall
georgewrmarshall enabled auto-merge (squash) March 18, 2026 15:34
@georgewrmarshall
georgewrmarshall merged commit da3bdba into main Mar 18, 2026
22 checks passed
@georgewrmarshall
georgewrmarshall deleted the update-font-centrano1-to-geist branch March 18, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants