Skip to content
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

chore: upgrading design tokens from v4.2.0 to 5.0.0 and removing unneeded css #30216

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Feb 7, 2025

Description

This PR updates the @metamask/design-tokens package from v4.2.0 to v5.0.0 and removes the pending-colors.scss file. The error state colors (error-muted-hover and error-muted-pressed) that were previously defined locally are now available in the design tokens package.

The major version bump (v5.0.0) of design-tokens is due to breaking changes in TypeScript types, which don't affect the MetaMask extension since we don't use those type imports directly.

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/4171

Manual testing steps

  1. Pull down the branch and build the extension
  2. Navigate to the Storybook and open the Copyable component stories
  3. Test the "Sensitive" story variant:
    • Verify the hover state shows the correct error-muted-hover color
    • Verify the pressed state shows the correct error-muted-pressed color
  4. Verify no visual regressions in other error states across the application

Screenshots/Recordings

No visual changes expected as this is replacing locally defined colors with the same colors from the design system package

Before

before.mov

After

after.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed)
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Feb 7, 2025
@georgewrmarshall georgewrmarshall self-assigned this Feb 7, 2025
Copy link
Contributor

github-actions bot commented Feb 7, 2025

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.

Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] None 0 292 kB metamaskbot

View full report↗︎

@@ -300,7 +300,7 @@
"@metamask/browser-passworder": "^4.3.0",
"@metamask/contract-metadata": "^2.5.0",
"@metamask/controller-utils": "^11.4.0",
"@metamask/design-tokens": "^4.2.0",
"@metamask/design-tokens": "^5.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -3,7 +3,6 @@
*/
@import './reset.scss';
@import './utilities/fonts.scss';
@import './utilities/pending-colors.scss';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing deleted file import

Comment on lines -13 to -27
:root {
--color-error-muted-hover: #d738473f; // This is var(--brand-colors-red-red100) but with 20% opacity
--color-error-muted-pressed: #d738474c; // This is var(--brand-colors-red-red200) but with 30% opacity
}


/**
* Dark Theme Colors
* Colors for dark theme
*/

[data-theme='dark'] {
--color-error-muted-hover: #d738473f; // This is var(--brand-colors-red-red100) but with 20% opacity
--color-error-muted-pressed: #d738474c; // This is var(--brand-colors-red-red200) but with 30% opacity
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These colors were included in the design tokens v5

@georgewrmarshall georgewrmarshall marked this pull request as ready for review February 7, 2025 22:39
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner February 7, 2025 22:39
@metamaskbot
Copy link
Collaborator

Builds ready [7524732]
Page Load Metrics (1537 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14001915154412661
domContentLoaded13731862152112057
load13821915153712761
domInteractive2396462412
backgroundConnect106019157
firstReactRender1482442713
getState4429105
initialActions00000
loadScripts984136911099646
setupStore613821
uiStartup15622125175515072
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 354 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@georgewrmarshall georgewrmarshall added this pull request to the merge queue Feb 11, 2025
Merged via the queue into main with commit 103cfb5 Feb 11, 2025
82 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/removing-pending-colors branch February 11, 2025 17:56
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2025
@metamaskbot metamaskbot added the release-12.13.0 Issue or pull request that will be included in release 12.13.0 label Feb 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.13.0 Issue or pull request that will be included in release 12.13.0 team-design-system All issues relating to design system in Extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants