Skip to content

[material-ui] Remove unnecessary overridesResolvers from styled components#48204

Merged
sai6855 merged 5 commits intomui:masterfrom
sai6855:button-variants
Apr 6, 2026
Merged

[material-ui] Remove unnecessary overridesResolvers from styled components#48204
sai6855 merged 5 commits intomui:masterfrom
sai6855:button-variants

Conversation

@sai6855
Copy link
Copy Markdown
Member

@sai6855 sai6855 commented Apr 5, 2026

defaultOverridesResolver is run for all Material UI styled components, so these become redundant when there is only one style overrides slot.

changes done in this PR are similar to changes in #48082

@mui-bot
Copy link
Copy Markdown

mui-bot commented Apr 5, 2026

Netlify deploy preview

https://deploy-preview-48204--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material ▼-142B(-0.03%) ▼-21B(-0.01%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against f2dd27c

@sai6855 sai6855 changed the title Refactor button variant styles to use dynamic padding and font size m… Refactor button variant styles to use dynamic padding and font size mapping Apr 5, 2026
@sai6855 sai6855 changed the title Refactor button variant styles to use dynamic padding and font size mapping [material-ui] Remove unnecessary overridesResolvers from styled components Apr 5, 2026
@sai6855 sai6855 requested a review from ZeeshanTamboli April 5, 2026 16:10
@sai6855 sai6855 marked this pull request as ready for review April 6, 2026 04:56
@sai6855 sai6855 requested review from Copilot and siriwatknp April 6, 2026 04:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies Material UI styled slot definitions by removing redundant overridesResolver functions where a slot maps 1:1 to a single styleOverrides key, relying on createStyled’s default slot-based resolver behavior.

Changes:

  • Removed redundant overridesResolver from TableSortLabel’s Icon slot styled component.
  • Removed redundant overridesResolver from StepConnector’s Line slot styled component.
  • Removed redundant overridesResolver from ListItem’s secondaryAction slot and Drawer’s Paper slot styled components.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/mui-material/src/TableSortLabel/TableSortLabel.js Drops redundant Icon slot overridesResolver so defaults handle styleOverrides.icon.
packages/mui-material/src/StepConnector/StepConnector.js Drops redundant Line slot overridesResolver so defaults handle styleOverrides.line.
packages/mui-material/src/ListItem/ListItem.js Drops redundant secondaryAction slot overridesResolver so defaults handle styleOverrides.secondaryAction.
packages/mui-material/src/Drawer/Drawer.js Drops redundant Paper slot overridesResolver so defaults handle styleOverrides.paper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Good one.

@sai6855 sai6855 merged commit f1d35f6 into mui:master Apr 6, 2026
23 checks passed
@zannager zannager added the package: styled-engine Specific to @mui/styled-engine label Apr 6, 2026
@sai6855 sai6855 added the type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: styled-engine Specific to @mui/styled-engine type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants