Skip to content

chore: update buttons to be monochromatic #33847

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

Merged
merged 2 commits into from
Jun 25, 2025

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Jun 23, 2025

Description

This PR implements continued design updates to the Button component based on direction from product and design leadership. We previously merged updates to the button shape(here and here). This PR is to make the Button monochromatic.

Key changes:

  • Updating deprecated Button to use new icon colors
  • Updated component-library Button to use new icon colors
  • Added new icon colors to Box and design system types
  • Updated snapshots

Figma designs: https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?m=auto&node-id=1-304

buttons

Open in GitHub Codespaces

Related issues

Fixes: #33850

Manual testing steps

  1. Navigate through the extension — all primary and secondary buttons should now use monochromatic colors (e.g. dark grey, light grey, and white, depending on the theme).
  2. Run Storybook: yarn storybook
  3. Navigate to both the deprecated Button and the component library Button.
  4. Validate that primary and secondary variants render correctly.

Screenshots/Recordings

Before

Currently, the deprecated button is using monochromatic colors, but not the correct tokens. The component library button is still using primary/default(blurple).

before.app720.mov
storybook.before720.mov

After

In the PR, the deprecated button has been updated to use the correct icon color tokens, and the component library button now uses icon colors instead of the primary colors.

after720.mov
storybook.after720.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 self-assigned this Jun 23, 2025
@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Jun 23, 2025
@georgewrmarshall georgewrmarshall changed the title Fix/button monochrome updates chore: update buttons to be monochromatic Jun 23, 2025
Copy link
Contributor

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.

Comment on lines +3 to +4
color: var(--color-icon-inverse);
background-color: var(--color-icon-default-hover);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating buttons to use icon colors and removing the dropshadows

}

&:active {
color: var(--color-error-inverse);
background-color: var(--color-error-alternative);
background-color: var(--color-error-default-pressed);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating danger button to align with new tokens

@metamaskbot
Copy link
Collaborator

metamaskbot commented Jun 23, 2025

✨ Files requiring CODEOWNER review ✨

@MetaMask/confirmations (1 files, +2 -3)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 pages/
          • 📁 send/
            • 📁 __snapshots__/
              • 📄 send.test.js.snap +2 -3

🎨 @MetaMask/design-system-engineers (9 files, +53 -71)
  • 📁 ui/
    • 📁 components/
      • 📁 component-library/
        • 📁 button/
          • 📁 __snapshots__/
            • 📄 button.test.tsx.snap +3 -5
            • 📄 button.stories.tsx +8 -4
        • 📁 button-base/
          • 📄 button-base.scss +7 -0
        • 📁 button-primary/
          • 📁 __snapshots__/
            • 📄 button-primary.test.tsx.snap +1 -2
            • 📄 button-primary.scss +7 -15
            • 📄 button-primary.tsx +3 -4
        • 📁 button-secondary/
          • 📁 __snapshots__/
            • 📄 button-secondary.test.tsx.snap +1 -1
            • 📄 button-secondary.scss +6 -22
            • 📄 button-secondary.tsx +17 -18

💎 @MetaMask/metamask-assets (1 files, +4 -6)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 detected-token/
          • 📁 detected-token-ignored-popover/
            • 📁 __snapshots__/
              • 📄 detected-token-ignored-popover.test.tsx.snap +4 -6

🫰 @MetaMask/snaps-devs (1 files, +10 -10)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 snaps/
          • 📁 snap-ui-renderer/
            • 📁 __snapshots__/
              • 📄 snap-ui-renderer.test.js.snap +10 -10

🔄 @MetaMask/swaps-engineers (3 files, +4 -8)
  • 📁 ui/
    • 📁 pages/
      • 📁 bridge/
        • 📁 __snapshots__/
          • 📄 index.test.tsx.snap +1 -2
        • 📁 prepare/
          • 📁 __snapshots__/
            • 📄 bridge-cta-button.test.tsx.snap +1 -2
            • 📄 prepare-bridge-page.test.tsx.snap +2 -4

🖥️ @MetaMask/wallet-ux (7 files, +12 -16)
  • 📁 ui/
    • 📁 components/
      • 📁 multichain/
        • 📁 connect-accounts-modal/
          • 📁 __snapshots__/
            • 📄 connect-accounts-modal.test.tsx.snap +1 -2
        • 📁 import-account/
          • 📁 __snapshots__/
            • 📄 json.test.tsx.snap +2 -3
        • 📁 network-list-menu/
          • 📁 __snapshots__/
            • 📄 network-list-menu.test.js.snap +3 -4
          • 📁 add-rpc-url-modal/
            • 📁 __snapshots__/
              • 📄 add-rpc-url-modal.test.tsx.snap +1 -2
        • 📁 pages/
          • 📁 connections/
            • 📁 __snapshots__/
              • 📄 connections.test.tsx.snap +2 -2
          • 📁 send/
            • 📁 __snapshots__/
              • 📄 send.test.js.snap +2 -3
    • 📁 css/
      • 📁 design-system/
        • 📄 _colors.scss +1 -0

box-shadow:
var(--shadow-size-sm)
var(--color-shadow-primary);;
background-color: var(--color-background-muted-hover);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating secondary button to align with design

Comment on lines +125 to 134
<Box display={Display.Flex} gap={4}>
<Button danger>
Danger
</Button>
<Button variant={ButtonVariant.Secondary} danger>
Danger
</Button>
<Button {...args} variant={ButtonVariant.Link} danger>
Danger
</Button>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating story to show all danger variants

Screenshot 2025-06-23 at 12 46 24 PM

@@ -604,7 +604,7 @@ export const NetworkListMenu = ({ onClose }: NetworkListMenuProps) => {
padding={4}
marginTop={2}
gap={4}
backgroundColor={BackgroundColor.backgroundMuted}
backgroundColor={BackgroundColor.backgroundSection}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

revert this change

@@ -51,7 +51,7 @@ export const SiteCellConnectionListItem = ({
iconName={iconName}
size={AvatarIconSize.Md}
color={IconColor.iconAlternative}
backgroundColor={BackgroundColor.backgroundMuted}
backgroundColor={BackgroundColor.backgroundSection}
/>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revert this change

@@ -93,18 +93,18 @@

.btn-default,
.btn-primary {
color: var(--color-primary-inverse);
color: var(--color-icon-inverse);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating deprecated button to match new designs. As an aside we are close to eliminating this deprecated component altogether

Screenshot 2025-06-23 at 12 47 38 PM

Comment on lines -168 to -171
&:hover {
box-shadow: var(--shadow-size-sm) var(--color-shadow-default);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not using shadow on hover anymore

@@ -12,6 +12,7 @@ $color-map: (
'icon-default': --color-icon-default,
'icon-alternative': --color-icon-alternative,
'icon-muted': --color-icon-muted,
'icon-inverse': --color-icon-inverse,
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Jun 23, 2025

Choose a reason for hiding this comment

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

adding new icon color tokens that were introduced in design tokens v8 upgrade #33764

Comment on lines +121 to +124
iconDefault = 'icon-default',
iconAlternative = 'icon-alternative',
iconMuted = 'icon-muted',
iconInverse = 'icon-inverse',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding new icon colors to design system that were introduced in #33764

@georgewrmarshall georgewrmarshall force-pushed the fix/button-monochrome-updates branch from d9b80a0 to 9772ac3 Compare June 23, 2025 19:58
@georgewrmarshall georgewrmarshall marked this pull request as ready for review June 23, 2025 20:09
@georgewrmarshall georgewrmarshall requested review from a team as code owners June 23, 2025 20:09
@metamaskbot
Copy link
Collaborator

Builds ready [9772ac3]
UI Startup Metrics (1243 ± 66 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1243112614576612851337
load107594812446511271182
domContentLoaded106893312366611201178
domInteractive18145781737
firstPaint68870124443110781150
backgroundConnect8410310712
firstReactRender21164852131
getState1453771927
initialActions001001
loadScripts81668297565867932
setupStore85314820
WebpackHomeuiStartup22301687283321623282636
load16911265217418318122013
domContentLoaded16841261216318318082003
domInteractive181192151460
firstPaint1686470183190273
backgroundConnect22105272535
firstReactRender26391426120393411
getState1144161224
initialActions612892835
loadScripts16811260215318118051992
setupStore197316301826
FirefoxBrowserifyHomeuiStartup13621216178110714121583
load1198107214648112461349
domContentLoaded1198107214648112461349
domInteractive1123732350118229
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect21136792236
firstReactRender24204132429
getState94719826
initialActions001001
loadScripts1180106014418012301335
setupStore9411015720
WebpackHomeuiStartup15771390212617516482073
load13661191184114514591703
domContentLoaded13661191184014514581703
domInteractive99303676991300
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect22164362241
firstReactRender40316354349
getState146101121233
initialActions002111
loadScripts13471172181614414421681
setupStore85345824
Benchmark value 1243 exceeds gate value 1234 for chrome browserify home mean uiStartup
Benchmark value 1075 exceeds gate value 1070 for chrome browserify home mean load
Benchmark value 1068 exceeds gate value 1061 for chrome browserify home mean domContentLoaded
Benchmark value 20 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 2230 exceeds gate value 2192 for chrome webpack home mean uiStartup
Benchmark value 263 exceeds gate value 235 for chrome webpack home mean firstReactRender
Benchmark value 2636 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 60 exceeds gate value 57 for chrome webpack home p95 domInteractive
Benchmark value 411 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 1992 exceeds gate value 1970 for chrome webpack home p95 loadScripts
Benchmark value 112 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore
Benchmark value 229 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 26 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 2073 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 1703 exceeds gate value 1660 for firefox webpack home p95 load
Benchmark value 1703 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded
Benchmark value 300 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 33 exceeds gate value 32 for firefox webpack home p95 getState
Benchmark value 1681 exceeds gate value 1630 for firefox webpack home p95 loadScripts
Sum of mean exceeds: 93ms | Sum of p95 exceeds: 707ms
Sum of all benchmark exceeds: 800ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0%)
  • ui: 789 Bytes (0.01%)
  • common: 105 Bytes (0%)

Copy link
Contributor

@brianacnguyen brianacnguyen left a comment

Choose a reason for hiding this comment

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

Can you make sure to update the focus state as well?

@georgewrmarshall georgewrmarshall marked this pull request as draft June 24, 2025 15:11
auto-merge was automatically disabled June 24, 2025 15:11

Pull request was converted to draft

github-merge-queue bot pushed a commit that referenced this pull request Jun 24, 2025
…3854)

## **Description**

This PR replaces the deprecated `ui/components/ui/button` components to
the component library `Button` component across multiple files. Once
this PR is merged we can delete `ui/components/ui/button` in another PR
which will significantly help with future Button iterations as well as
[updating the buttons to
monochome](#33847)

**Reason for the change:**
The old button component has been deprecated in favor of the component
library Button(and soon the monorepo component) which provides better
TypeScript support, improved accessibility features, and consistent
styling aligned with the MetaMask design system.

**What is the improvement/solution:**
- Replaced 11 instances of deprecated button imports with new component
library imports
- Updated button props from `type` to `variant` using `ButtonVariant`
enum
- Converted danger buttons to use the `danger` prop instead of
`type="danger"`
- Updated test snapshots to reflect new button class names and structure
- Maintained all existing functionality while improving code consistency

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/33854?quickstart=1)

## **Related issues**

Fixes: #18896

## **Manual testing steps**

1. View various file updates in storybook
2. Confirm visual changes

## **Screenshots/Recordings**

Before and after screenshots added in code comments for easier review

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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 force-pushed the fix/button-monochrome-updates branch from 9772ac3 to 4ef6aa2 Compare June 24, 2025 23:23
Comment on lines +8 to +14
// Focus styles from monorepo button
&:focus-visible {
outline: 2px solid var(--color-primary-default);
outline-offset: 2px;
box-shadow: none;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding focus state to component-library button cc @brianacnguyen

focus.component-library720.mov

Comment on lines +20 to +24
&:focus-visible {
outline: 2px solid var(--color-primary-default);
outline-offset: 2px;
box-shadow: none;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding focus states to old button cc @brianacnguyen

focus.old.button720.mov

@georgewrmarshall georgewrmarshall marked this pull request as ready for review June 24, 2025 23:31
@metamaskbot
Copy link
Collaborator

Builds ready [4ef6aa2]
UI Startup Metrics (1176 ± 56 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1176107213265612101278
load101390611475510461116
domContentLoaded100690111425510381111
domInteractive1813126131629
firstPaint67991115939910271070
backgroundConnect84295823
firstReactRender23165272338
getState1463771829
initialActions001001
loadScripts80170094554835908
setupStore95314818
WebpackHomeuiStartup21701607282123723262609
load16331217216318817491971
domContentLoaded16271213215218717421957
domInteractive1811154181455
firstPaint1747757770199291
backgroundConnect2310283272534
firstReactRender27091414123386404
getState1143151326
initialActions612972935
loadScripts16221212214118417361946
setupStore217316421829
FirefoxBrowserifyHomeuiStartup13451194181111413981606
load1184106114848212331346
domContentLoaded1184106114848212321346
domInteractive1153651170115301
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2213116122145
firstReactRender23203822428
getState10413815835
initialActions002001
loadScripts1166103714547912191320
setupStore847210721
WebpackHomeuiStartup15341359225017515881946
load13281160195115114071632
domContentLoaded13271159195115114071631
domInteractive96314787086277
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2315110112340
firstReactRender40315844247
getState147102121233
initialActions102111
loadScripts13071145192114813891576
setupStore85374819
Benchmark value 23 exceeds gate value 18 for chrome browserify home p95 backgroundConnect
Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore
Benchmark value 271 exceeds gate value 235 for chrome webpack home mean firstReactRender
Benchmark value 2610 exceeds gate value 2454 for chrome webpack home p95 uiStartup
Benchmark value 404 exceeds gate value 370 for chrome webpack home p95 firstReactRender
Benchmark value 115 exceeds gate value 110 for firefox browserify home mean domInteractive
Benchmark value 301 exceeds gate value 195 for firefox browserify home p95 domInteractive
Benchmark value 35 exceeds gate value 24 for firefox browserify home p95 getState
Benchmark value 41 exceeds gate value 38 for firefox webpack home mean firstReactRender
Benchmark value 1946 exceeds gate value 1935 for firefox webpack home p95 uiStartup
Benchmark value 277 exceeds gate value 156 for firefox webpack home p95 domInteractive
Benchmark value 33 exceeds gate value 32 for firefox webpack home p95 getState
Sum of mean exceeds: 44ms | Sum of p95 exceeds: 446ms
Sum of all benchmark exceeds: 490ms

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 23 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 120 Bytes (0%)

Copy link
Contributor

@jpuri jpuri left a comment

Choose a reason for hiding this comment

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

Changes in files owned by confirmations team look good 👍

Copy link

@amitabh94 amitabh94 left a comment

Choose a reason for hiding this comment

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

Swap/bridge changes LGTM!

Copy link
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

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

Tested Snaps changes and looks good.

@georgewrmarshall georgewrmarshall added this pull request to the merge queue Jun 25, 2025
Merged via the queue into main with commit 8381ef7 Jun 25, 2025
146 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/button-monochrome-updates branch June 25, 2025 19:54
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2025
@metamaskbot metamaskbot added the release-12.23.0 Issue or pull request that will be included in release 12.23.0 label Jun 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.23.0 Issue or pull request that will be included in release 12.23.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.

Update Button color to monochomatic
9 participants