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: removing more unused css #30217

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Conversation

georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Feb 7, 2025

Description

This PR removes unused and deprecated CSS from the extension codebase, including:

  • Removal of deprecated .error class styling
  • Removal of unused form input styling
  • Removal of deprecated utility classes from itcss/tools/index
  • Cleanup of old unused color variables (--mainnet)

These changes help reduce technical debt and simplify our CSS architecture by removing legacy code that is no longer in use.

Related issues

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

Manual testing steps

  1. Pull down branch and build the extension
  2. Test the following scenarios to ensure no visual regressions:
    • Import account flows (previously used .error class)
    • Form inputs across the application
    • Network indicator colors (mainnet specifically)
  3. Verify no console errors related to missing CSS classes

Screenshots/Recordings

Screenshots of unused classnames in code comments

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR to verify no visual regressions
  • I confirm that this PR successfully removes unused CSS without impacting existing functionality
  • I've verified the changes align with our move away from the ITCSS architecture

@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.

@@ -1859,7 +1859,7 @@ export const networkList = [
{
blockExplorerUrl: 'https://etherscan.io',
chainId: '0x1',
iconColor: 'var(--mainnet)',
iconColor: 'var(--color-primary-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.

Updating storybook test data not used in prod

Comment on lines -46 to -57
/*
This error class is used in the following files still:
/ui/pages/create-account/import-account/json.js
/ui/pages/create-account/import-account/private-key.js
*/
.error {
color: var(--color-error-default);
margin-top: 3px;
margin-bottom: 9px;
overflow-wrap: anywhere;
}

Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Feb 7, 2025

Choose a reason for hiding this comment

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

error className is not used. I checked both json.js and private-key.js. Additionally, using the regex

className=["'{`][^"'`}]*error[^"'`}]*["'}`]

to search for instances of error in a className prop returned no exact matches.

Screenshot 2025-02-07 at 2 56 02 PM

@@ -32,7 +32,6 @@ $color-map: (
'info-default': --color-info-default,
'info-muted': --color-info-muted,
'info-inverse': --color-info-inverse,
'mainnet': --mainnet,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer used

@@ -25,7 +25,6 @@
overtime.
*/
@import './itcss/settings/index';
@import './itcss/tools/index';
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

@@ -1 +0,0 @@
@import './utilities';
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 -6 to -9
.flex-column {
display: flex;
flex-direction: column;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

flex-column class is not used

Screenshot 2025-02-07 at 2 57 54 PM

Comment on lines -11 to -14
.flex-row {
display: flex;
flex-direction: row;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

flex-row classname is not used

Screenshot 2025-02-07 at 2 58 18 PM

Comment on lines -16 to -18
.pointer {
cursor: pointer;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pointer is not used as a classname

Screenshot 2025-02-07 at 2 58 48 PM

Comment on lines -20 to -32
.cursor-pointer {
cursor: pointer;
transform-origin: center center;
transition: transform 50ms ease-in-out;
}

.cursor-pointer:hover {
transform: scale(1.05);
}

.cursor-pointer:active {
transform: scale(0.97);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cursor-pointer classname is not used

Screenshot 2025-02-07 at 2 59 22 PM

Comment on lines -34 to -37
.drop-menu-item {
display: flex;
align-items: center;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

drop-menu-item classname is not used

Screenshot 2025-02-07 at 3 00 07 PM

Comment on lines -7 to -9
// Accents
// Everything below this line is part of the new color system
--mainnet: #29b6af;
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 unused --mainnet CSS variable

Screenshot 2025-02-07 at 3 00 37 PM

@@ -36,7 +36,6 @@ export enum Color {
infoDefault = 'info-default',
infoMuted = 'info-muted',
infoInverse = 'info-inverse',
mainnet = 'mainnet',
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 from Color enum as it is not used

Screenshot 2025-02-07 at 3 01 12 PM

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

Builds ready [4e990a5]
Page Load Metrics (1648 ± 51 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14711940165110751
domContentLoaded14571911162411053
load14721937164810651
domInteractive25110472713
backgroundConnect105925168
firstReactRender1698412713
getState55013157
initialActions01000
loadScripts1035137111809043
setupStore76114147
uiStartup17372169191512058
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: -20 Bytes (-0.00%)

@georgewrmarshall georgewrmarshall added this pull request to the merge queue Feb 11, 2025
Merged via the queue into main with commit d1e00a8 Feb 11, 2025
83 checks passed
@georgewrmarshall georgewrmarshall deleted the fix/remove-unused-css-2 branch February 11, 2025 17:58
@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