-
Notifications
You must be signed in to change notification settings - Fork 5.2k
chore: Updating Text component "body" font sizes #31494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Review the following changes in direct dependencies. Learn more about Socket for GitHub ↗.
|
66b28b3
to
2986273
Compare
✨ Files requiring CODEOWNER review ✨🎨 @MetaMask/design-system-engineers
🫰 @MetaMask/snaps-devs
🖥️ @MetaMask/wallet-ux
|
2986273
to
dfc7ea2
Compare
74b45c7
to
f5a8b4c
Compare
@@ -2,5 +2,5 @@ | |||
export const metamaskStorybookTheme = { | |||
brandTitle: 'MetaMask Storybook', | |||
// Typography | |||
fontBase: 'var(--font-family-sans)', | |||
fontBase: 'var(--font-family-default)', // from @metamask/design-tokens stylesheet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing removed --font-family-sans
with --font-family-default
as per the migration guide
Have also done a check to ensure there are no remaining instances of --font-family-sans
in the codebase
@@ -265,7 +265,7 @@ | |||
"@metamask/browser-passworder": "^4.3.0", | |||
"@metamask/contract-metadata": "^2.5.0", | |||
"@metamask/controller-utils": "^11.4.0", | |||
"@metamask/design-tokens": "^6.0.1", | |||
"@metamask/design-tokens": "^7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,6 +1,6 @@ | |||
@use "sass:map"; | |||
|
|||
$font-family: var(--font-family-sans); // --font-family-sans from @metamask/design-tokens stylesheet | |||
$font-family: var(--font-family-default); // from @metamask/design-tokens stylesheet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replacing removed --font-family-sans
with --font-family-default
as per the migration guide
f5a8b4c
to
5013598
Compare
… increased font size has moved content
5013598
to
f4532de
Compare
// wait and scroll if necessary | ||
await driver.clickElementSafe('[data-testid="snap-install-scroll"]'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These e2e tests are failing because the increased font size shifts the content downward, triggering the scrollbar and button visibility, which disables the Confirm button. Unlike other snap e2e tests, this test-snap-ethprovider.spec.js
and test-snap-revoke-perm.spec.js
don't check for the scrollbar. Adding that check here resolves the issue.
Builds ready [9e3c5e6]
UI Startup Metrics (1207 ± 72 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Helpful comments as always
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from my comment, this will require a bit more time to review that the change isn't breaking any snap surfaces (I know we were using specific font sizes in at least a couple places and not sure if there was any discussion about the impact of this particular part of the redesign). Will leave another review by tomorrow.
3634465
Builds ready [3634465]
UI Startup Metrics (1168 ± 54 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [5a8f65f]
UI Startup Metrics (1246 ± 57 ms)
Bundle size diffs
|
I have read the CLA Document and I hereby sign the CLA |
Builds ready [7952774]
UI Startup Metrics (1230 ± 54 ms)
|
Builds ready [7952774]
UI Startup Metrics (1224 ± 62 ms)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, checked all snap surfaces that use Text
.
Description
This PR updates the
Text
component's "body" variants to match the large typography sizes as part of the brand evolution. This change improves accessibility and readability across the extension by making text larger and more legible for users.Key changes:
Text
component "body" variants to match large typography scale16px
→18px
14px
→16px
12px
→14px
10px
→12px
Text
component have not been updated. These can be reviewed and updated on a case-by-case basis. Image below shows542
instances of custom font size overrides@metamask/design-tokens
to version 7.0.0 which includes the new typography scaleRelated issues
Fixes: #31172
Manual testing steps
Testing inside the extension
Testing the
Text
component in Storybook:yarn storybook
or open the build linked in this PR.Text
component’s Variant story.Screenshots/Recordings
Before
Navigating around the extension in popup view using a base
14px
font sizebefore720.mov
Text component in Storybook all "body" variants change sizes in smaller/larger viewports
beforesb720.mov
After
Navigating around the extension resize Text components work as expected
after720.mov
Text component in Storybook all "body" variants stay the same size regardless of window size
aftersb720.mov
Pre-merge author checklist
Pre-merge reviewer checklist