Skip to content

chore: updating old button and removing deprecated disabled colors#24970

Merged
georgewrmarshall merged 2 commits intodevelopfrom
remove-primary-disabled-color
Jun 4, 2024
Merged

chore: updating old button and removing deprecated disabled colors#24970
georgewrmarshall merged 2 commits intodevelopfrom
remove-primary-disabled-color

Conversation

@georgewrmarshall
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall commented May 31, 2024

Description

This pull request removes the primary-disabled and error-disabled colors in preparation for upgrading to design token v4. The updates include modifications to the old button component, and the removal of these colors from styles and helpers.

Open in GitHub Codespaces

Related issues

Fixes: #24962 #24963

Manual testing steps

  1. Go to the storybook build of this PR
  2. Go to the old button component and check that it works as expected for all types in disabled state
  3. Search for deprecated instances of primary-disabled and error-disabled to ensure none remain

Screenshots/Recordings

Before

before720.mov

After

after720.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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 added the team-design-system All issues relating to design system in Extension label May 31, 2024
@georgewrmarshall georgewrmarshall self-assigned this May 31, 2024
@github-actions
Copy link
Copy Markdown
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.

@georgewrmarshall georgewrmarshall force-pushed the remove-primary-disabled-color branch from a9936a9 to e09b865 Compare May 31, 2024 23:13
--color-border-primary-hover: var(--color-primary-default-hover);

.btn-primary {
background-color: var(--color-background-primary);
Copy link
Copy Markdown
Contributor Author

@georgewrmarshall georgewrmarshall May 31, 2024

Choose a reason for hiding this comment

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

Updating color documentation

Before

color.docs720.mov

After

after720.mov

&[disabled] {
cursor: auto;
opacity: 0.5;
opacity: var(--opacity-disabled);
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.

Comment on lines 89 to 84
}

&--disabled,
&[disabled] {
opacity: 1;
color: var(--color-error-disabled);
}
}
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.

Warning disabled works as expected checking local branch against develop branch GitHub storybook

warning720.mov

'primary-alternative': --color-primary-alternative,
'primary-muted': --color-primary-muted,
'primary-inverse': --color-primary-inverse,
'primary-disabled': --color-primary-disabled,
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.

No instances of primary-disabled exists

Screenshot 2024-05-31 at 4 28 46 PM

'error-alternative': --color-error-alternative,
'error-muted': --color-error-muted,
'error-inverse': --color-error-inverse,
'error-disabled': --color-error-disabled,
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.

No instances of error-disabled exist in code base

Screenshot 2024-05-31 at 4 29 08 PM

primaryAlternative = 'primary-alternative',
primaryMuted = 'primary-muted',
primaryInverse = 'primary-inverse',
primaryDisabled = 'primary-disabled',
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.

No instances of primaryDisabled used in codebase

Screenshot 2024-05-31 at 4 29 31 PM

errorAlternative = 'error-alternative',
errorMuted = 'error-muted',
errorInverse = 'error-inverse',
errorDisabled = 'error-disabled',
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.

no instances of errorDisabled used in code base

Screenshot 2024-05-31 at 4 29 23 PM

Comment on lines 34 to 48
.btn-secondary {
color: var(--color-primary-default);
border: 1px solid var(--color-primary-muted);
border: 1px solid var(--color-primary-default);
background-color: var(--color-background-default);

&:hover {
border-color: var(--color-primary-default);
}

&:active {
background: var(--color-primary-muted);
color: var(--color-primary-inverse);
background: var(--color-primary-default);
border-color: var(--color-primary-default);
}

&--disabled,
&[disabled] {
opacity: 1;
color: var(--color-primary-muted);
}
}
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.

Checking secondary type button local build against develop github storybook works as expected

after.secondary720.mov

Comment on lines -137 to +119
opacity: 1;
color: var(--color-text-muted);
opacity: var(--opacity-disabled);
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.

Button default adheres to design system standards and works as expected when comparing against develop github storybook

after.default720.mov

Comment on lines -112 to -118

&--disabled,
&[disabled] {
opacity: 1;
border-color: var(--color-error-disabled);
background-color: var(--color-error-disabled);
}
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.

Button danger primary works as expected checking local branch storybook against develop github storybook

after.danger720.mov

input[type="submit"][disabled] {
cursor: not-allowed;
opacity: 0.5;
opacity: var(--opacity-disabled);
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.

Comment on lines -182 to -184
opacity: 1;
pointer-events: none;
color: var(--color-primary-disabled);
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.

Button link works as expected when comparing local against develop github storybook

link.after720.mov

Comment on lines -229 to -234
&--disabled,
&[disabled] {
border-color: var(--color-primary-disabled);
color: var(--color-primary-disabled);
}

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.

duplicate CSS

Comment on lines -247 to -252
&--disabled,
&[disabled] {
border-color: var(--color-border-muted);
color: var(--color-text-muted);
}

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.

duplicate CSS

Comment on lines -265 to -270
&--disabled,
&[disabled] {
border-color: var(--color-error-disabled);
color: var(--color-error-disabled);
}

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.

duplicate CSS

Comment on lines -301 to -305
&--disabled,
&[disabled] {
background-color: var(--color-primary-disabled);
}

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.

duplicate CSS

Comment on lines -318 to -322
&--disabled,
&[disabled] {
background-color: var(--color-error-disabled);
}

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.

duplicate CSS

Comment on lines -349 to -351
opacity: 1;
pointer-events: none;
color: var(--color-primary-disabled);
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.

duplicate CSS

@georgewrmarshall georgewrmarshall marked this pull request as ready for review May 31, 2024 23:45
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner May 31, 2024 23:45
@codecov
Copy link
Copy Markdown

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.70%. Comparing base (0b0bf11) to head (0c23ef4).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24970      +/-   ##
===========================================
- Coverage    65.70%   65.70%   -0.00%     
===========================================
  Files         1366     1366              
  Lines        54361    54359       -2     
  Branches     14141    14141              
===========================================
- Hits         35716    35713       -3     
- Misses       18645    18646       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [0c23ef4]
Page Load Metrics (50 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7110983105
domContentLoaded9201121
load42635063
domInteractive9201121

@georgewrmarshall georgewrmarshall merged commit 88b0fdb into develop Jun 4, 2024
@georgewrmarshall georgewrmarshall deleted the remove-primary-disabled-color branch June 4, 2024 17:52
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2024
@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-12.0.0 Issue or pull request that will be included in release 12.0.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.

chore: remove all instances of primary-disabled color

5 participants