[button] Remove deprecated classes by silviuaavram · Pull Request #48012 · mui/material-ui (original) (raw)

@silviuaavram

@mui-bot

Copilot AI review requested due to automatic review settings

March 17, 2026 13:39

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 removes deprecated Button utility CSS classes (e.g. textPrimary, outlinedSizeSmall, iconSizeSmall) from the Material UI Button implementation and updates the API docs/tests/migration guide to reflect the new “combine base classes” approach (e.g. .MuiButton-text.MuiButton-colorPrimary).

Changes:

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file

File Description
packages/mui-material/src/Button/buttonClasses.ts Drops deprecated class keys from the public buttonClasses contract and utility class generation list.
packages/mui-material/src/Button/Button.js Stops composing deprecated variant+color / variant+size / iconSize* utility classes and removes them from overrides resolvers.
packages/mui-material/src/Button/Button.test.js Updates assertions to use color* and size* classes instead of deprecated combined class names.
docs/translations/api-docs/button/button.json Removes deprecated class descriptions from translated API docs data.
docs/pages/material-ui/api/button.json Removes deprecated class entries from the generated Button API page JSON.
docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md Adds an upgrade note listing removed deprecated Button classes and suggested replacements.

Choose a reason for hiding this comment

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

Pull request overview

Removes deprecated Button CSS utility classes from the Material UI codebase as part of the v9 upgrade path, and updates tests/docs to reflect the new class composition approach (variant + color/size classes combined via selectors rather than dedicated “combined” class keys).

Changes:

Reviewed changes

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

Show a summary per file

File Description
packages/mui-material/src/ButtonGroup/ButtonGroup.test.js Updates assertions to use non-deprecated Button classes.
packages/mui-material/src/Button/buttonClasses.ts Removes deprecated class keys from the ButtonClasses interface and generated utility classes.
packages/mui-material/src/Button/Button.test.js Rewrites tests to validate variant + color*/size* classes instead of deprecated combined classes.
packages/mui-material/src/Button/Button.js Stops emitting deprecated combined utility classes and removes them from overrides resolution paths.
docs/translations/api-docs/button/button.json Removes deprecated class descriptions from translated Button API docs.
docs/pages/material-ui/api/button.json Removes deprecated class entries from the Button API page data.
docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md Adds v9 upgrade guidance for removed deprecated Button classes and codemod usage.

Comments suppressed due to low confidence (1)

packages/mui-material/src/Button/Button.js:91

    return [
      styles.root,
      styles[ownerState.variant],
      styles[`size${capitalize(ownerState.size)}`],
      ownerState.color === 'inherit' && styles.colorInherit,
      ownerState.disableElevation && styles.disableElevation,
      ownerState.fullWidth && styles.fullWidth,
      ownerState.loading && styles.loading,
    ];

mnajdova

npx @mui/codemod@latest deprecations/button-classes
```
The following deprecated `Button` CSS classes have been removed:

Choose a reason for hiding this comment

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

When we are removing classes, we are also removing the keys in the theme overrides styles key. These are a bit of an "older" API but still valid. Should we mention these as breaking changes too? cc @siriwatknp

Choose a reason for hiding this comment

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

yes.

siriwatknp

ZeeshanTamboli

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})