-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
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. |
color: var(--color-icon-inverse); | ||
background-color: var(--color-icon-default-hover); |
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.
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); |
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.
Updating danger button to align with new tokens
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (1 files, +2 -3)
🎨 @MetaMask/design-system-engineers (9 files, +53 -71)
💎 @MetaMask/metamask-assets (1 files, +4 -6)
🫰 @MetaMask/snaps-devs (1 files, +10 -10)
🔄 @MetaMask/swaps-engineers (3 files, +4 -8)
🖥️ @MetaMask/wallet-ux (7 files, +12 -16)
|
box-shadow: | ||
var(--shadow-size-sm) | ||
var(--color-shadow-primary);; | ||
background-color: var(--color-background-muted-hover); |
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.
Updating secondary button to align with design
<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> |
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.
@@ -604,7 +604,7 @@ export const NetworkListMenu = ({ onClose }: NetworkListMenuProps) => { | |||
padding={4} | |||
marginTop={2} | |||
gap={4} | |||
backgroundColor={BackgroundColor.backgroundMuted} | |||
backgroundColor={BackgroundColor.backgroundSection} |
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.
revert this change
@@ -51,7 +51,7 @@ export const SiteCellConnectionListItem = ({ | |||
iconName={iconName} | |||
size={AvatarIconSize.Md} | |||
color={IconColor.iconAlternative} | |||
backgroundColor={BackgroundColor.backgroundMuted} | |||
backgroundColor={BackgroundColor.backgroundSection} | |||
/> |
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.
Revert this change
@@ -93,18 +93,18 @@ | |||
|
|||
.btn-default, | |||
.btn-primary { | |||
color: var(--color-primary-inverse); | |||
color: var(--color-icon-inverse); |
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.
&:hover { | ||
box-shadow: var(--shadow-size-sm) var(--color-shadow-default); | ||
} | ||
|
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.
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, |
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.
adding new icon color tokens that were introduced in design tokens v8 upgrade #33764
iconDefault = 'icon-default', | ||
iconAlternative = 'icon-alternative', | ||
iconMuted = 'icon-muted', | ||
iconInverse = 'icon-inverse', |
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.
Adding new icon colors to design system that were introduced in #33764
d9b80a0
to
9772ac3
Compare
Builds ready [9772ac3]
UI Startup Metrics (1243 ± 66 ms)
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!]
|
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.
Can you make sure to update the focus state as well?
Pull request was converted to draft
…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 [](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.
9772ac3
to
4ef6aa2
Compare
// Focus styles from monorepo button | ||
&:focus-visible { | ||
outline: 2px solid var(--color-primary-default); | ||
outline-offset: 2px; | ||
box-shadow: none; | ||
} | ||
|
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.
Adding focus state to component-library button cc @brianacnguyen
focus.component-library720.mov
&:focus-visible { | ||
outline: 2px solid var(--color-primary-default); | ||
outline-offset: 2px; | ||
box-shadow: none; | ||
} |
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.
Adding focus states to old button cc @brianacnguyen
focus.old.button720.mov
Builds ready [4ef6aa2]
UI Startup Metrics (1176 ± 56 ms)
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!]
|
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.
Changes in files owned by confirmations team look good 👍
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.
Swap/bridge changes LGTM!
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.
Tested Snaps changes and looks good.
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:
Figma designs: https://www.figma.com/design/1D6tnzXqWgnUC3spaAOELN/%F0%9F%A6%8A-WIP--MMDS-Components?m=auto&node-id=1-304
Related issues
Fixes: #33850
Manual testing steps
yarn storybook
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