Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions docs/data/material/customization/theme-components/GlobalCss.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ const theme = createTheme({
// Style sheet name ⚛️
styleOverrides: {
// Name of the rule
textPrimary: {
// Some CSS
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
borderRadius: 3,
border: 0,
color: 'white',
height: 48,
padding: '0 30px',
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
root: {
variants: [
{
props: { variant: 'text', color: 'primary' },
style: {
// Some CSS
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
borderRadius: 3,
border: 0,
color: 'white',
height: 48,
padding: '0 30px',
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
},
},
],
},
},
},
Expand Down
25 changes: 16 additions & 9 deletions docs/data/material/customization/theme-components/GlobalCss.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,22 @@ const theme = createTheme({
// Style sheet name ⚛️
styleOverrides: {
// Name of the rule
textPrimary: {
// Some CSS
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
borderRadius: 3,
border: 0,
color: 'white',
height: 48,
padding: '0 30px',
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
root: {
variants: [
{
props: { variant: 'text', color: 'primary' },
style: {
// Some CSS
background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
borderRadius: 3,
border: 0,
color: 'white',
height: 48,
padding: '0 30px',
boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
},
},
],
},
},
},
Expand Down
127 changes: 127 additions & 0 deletions docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,133 @@ The following deprecated props have been removed from the `Badge` component:
/>
```

#### Button deprecated CSS classes removed

Use the [button-classes codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#button-classes) below to migrate the code as described in the following section:

```bash
npx @mui/codemod@latest deprecations/button-classes <path>
```

The following deprecated `Button` CSS classes have been removed:

- `textInherit` → use `.MuiButton-text.MuiButton-colorInherit`
- `textPrimary` → use `.MuiButton-text.MuiButton-colorPrimary`
- `textSecondary` → use `.MuiButton-text.MuiButton-colorSecondary`
- `textSuccess` → use `.MuiButton-text.MuiButton-colorSuccess`
- `textError` → use `.MuiButton-text.MuiButton-colorError`
- `textInfo` → use `.MuiButton-text.MuiButton-colorInfo`
- `textWarning` → use `.MuiButton-text.MuiButton-colorWarning`
- `outlinedInherit` → use `.MuiButton-outlined.MuiButton-colorInherit`
- `outlinedPrimary` → use `.MuiButton-outlined.MuiButton-colorPrimary`
- `outlinedSecondary` → use `.MuiButton-outlined.MuiButton-colorSecondary`
- `outlinedSuccess` → use `.MuiButton-outlined.MuiButton-colorSuccess`
- `outlinedError` → use `.MuiButton-outlined.MuiButton-colorError`
- `outlinedInfo` → use `.MuiButton-outlined.MuiButton-colorInfo`
- `outlinedWarning` → use `.MuiButton-outlined.MuiButton-colorWarning`
- `containedInherit` → use `.MuiButton-contained.MuiButton-colorInherit`
- `containedPrimary` → use `.MuiButton-contained.MuiButton-colorPrimary`
- `containedSecondary` → use `.MuiButton-contained.MuiButton-colorSecondary`
- `containedSuccess` → use `.MuiButton-contained.MuiButton-colorSuccess`
- `containedError` → use `.MuiButton-contained.MuiButton-colorError`
- `containedInfo` → use `.MuiButton-contained.MuiButton-colorInfo`
- `containedWarning` → use `.MuiButton-contained.MuiButton-colorWarning`
- `textSizeSmall` → use `.MuiButton-text.MuiButton-sizeSmall`
- `textSizeMedium` → use `.MuiButton-text.MuiButton-sizeMedium`
- `textSizeLarge` → use `.MuiButton-text.MuiButton-sizeLarge`
- `outlinedSizeSmall` → use `.MuiButton-outlined.MuiButton-sizeSmall`
- `outlinedSizeMedium` → use `.MuiButton-outlined.MuiButton-sizeMedium`
- `outlinedSizeLarge` → use `.MuiButton-outlined.MuiButton-sizeLarge`
- `containedSizeSmall` → use `.MuiButton-contained.MuiButton-sizeSmall`
- `containedSizeMedium` → use `.MuiButton-contained.MuiButton-sizeMedium`
- `containedSizeLarge` → use `.MuiButton-contained.MuiButton-sizeLarge`
- `iconSizeSmall` → use `.MuiButton-root.MuiButton-sizeSmall > .MuiButton-icon`
- `iconSizeMedium` → use `.MuiButton-root.MuiButton-sizeMedium > .MuiButton-icon`
- `iconSizeLarge` → use `.MuiButton-root.MuiButton-sizeLarge > .MuiButton-icon`

If you were using these deprecated class names as `styleOverrides` keys in your theme, use the `variants` array in the `root` override instead:

```diff
const theme = createTheme({
components: {
MuiButton: {
styleOverrides: {
- textInherit: { color: 'inherit' },
- textPrimary: { color: 'blue' },
- textSecondary: { color: 'purple' },
- textSuccess: { color: 'green' },
- textError: { color: 'red' },
- textInfo: { color: 'cyan' },
- textWarning: { color: 'orange' },
- outlinedInherit: { borderColor: 'inherit' },
- outlinedPrimary: { borderColor: 'blue' },
- outlinedSecondary: { borderColor: 'purple' },
- outlinedSuccess: { borderColor: 'green' },
- outlinedError: { borderColor: 'red' },
- outlinedInfo: { borderColor: 'cyan' },
- outlinedWarning: { borderColor: 'orange' },
- containedInherit: { backgroundColor: 'inherit' },
- containedPrimary: { backgroundColor: 'blue' },
- containedSecondary: { backgroundColor: 'purple' },
- containedSuccess: { backgroundColor: 'green' },
- containedError: { backgroundColor: 'red' },
- containedInfo: { backgroundColor: 'cyan' },
- containedWarning: { backgroundColor: 'orange' },
- textSizeSmall: { fontSize: '0.75rem' },
- textSizeMedium: { fontSize: '0.875rem' },
- textSizeLarge: { fontSize: '1rem' },
- outlinedSizeSmall: { fontSize: '0.75rem' },
- outlinedSizeMedium: { fontSize: '0.875rem' },
- outlinedSizeLarge: { fontSize: '1rem' },
- containedSizeSmall: { fontSize: '0.75rem' },
- containedSizeMedium: { fontSize: '0.875rem' },
- containedSizeLarge: { fontSize: '1rem' },
- iconSizeSmall: { fontSize: '18px' },
- iconSizeMedium: { fontSize: '20px' },
- iconSizeLarge: { fontSize: '22px' },
+ root: {
+ variants: [
+ { props: { variant: 'text', color: 'inherit' }, style: { color: 'inherit' } },
+ { props: { variant: 'text', color: 'primary' }, style: { color: 'blue' } },
+ { props: { variant: 'text', color: 'secondary' }, style: { color: 'purple' } },
+ { props: { variant: 'text', color: 'success' }, style: { color: 'green' } },
+ { props: { variant: 'text', color: 'error' }, style: { color: 'red' } },
+ { props: { variant: 'text', color: 'info' }, style: { color: 'cyan' } },
+ { props: { variant: 'text', color: 'warning' }, style: { color: 'orange' } },
+ { props: { variant: 'outlined', color: 'inherit' }, style: { borderColor: 'inherit' } },
+ { props: { variant: 'outlined', color: 'primary' }, style: { borderColor: 'blue' } },
+ { props: { variant: 'outlined', color: 'secondary' }, style: { borderColor: 'purple' } },
+ { props: { variant: 'outlined', color: 'success' }, style: { borderColor: 'green' } },
+ { props: { variant: 'outlined', color: 'error' }, style: { borderColor: 'red' } },
+ { props: { variant: 'outlined', color: 'info' }, style: { borderColor: 'cyan' } },
+ { props: { variant: 'outlined', color: 'warning' }, style: { borderColor: 'orange' } },
+ { props: { variant: 'contained', color: 'inherit' }, style: { backgroundColor: 'inherit' } },
+ { props: { variant: 'contained', color: 'primary' }, style: { backgroundColor: 'blue' } },
+ { props: { variant: 'contained', color: 'secondary' }, style: { backgroundColor: 'purple' } },
+ { props: { variant: 'contained', color: 'success' }, style: { backgroundColor: 'green' } },
+ { props: { variant: 'contained', color: 'error' }, style: { backgroundColor: 'red' } },
+ { props: { variant: 'contained', color: 'info' }, style: { backgroundColor: 'cyan' } },
+ { props: { variant: 'contained', color: 'warning' }, style: { backgroundColor: 'orange' } },
+ { props: { variant: 'text', size: 'small' }, style: { fontSize: '0.75rem' } },
+ { props: { variant: 'text', size: 'medium' }, style: { fontSize: '0.875rem' } },
+ { props: { variant: 'text', size: 'large' }, style: { fontSize: '1rem' } },
+ { props: { variant: 'outlined', size: 'small' }, style: { fontSize: '0.75rem' } },
+ { props: { variant: 'outlined', size: 'medium' }, style: { fontSize: '0.875rem' } },
+ { props: { variant: 'outlined', size: 'large' }, style: { fontSize: '1rem' } },
+ { props: { variant: 'contained', size: 'small' }, style: { fontSize: '0.75rem' } },
+ { props: { variant: 'contained', size: 'medium' }, style: { fontSize: '0.875rem' } },
+ { props: { variant: 'contained', size: 'large' }, style: { fontSize: '1rem' } },
+ { props: { size: 'small' }, style: { '& .MuiButton-icon': { fontSize: '18px' } } },
+ { props: { size: 'medium' }, style: { '& .MuiButton-icon': { fontSize: '20px' } } },
+ { props: { size: 'large' }, style: { '& .MuiButton-icon': { fontSize: '22px' } } },
+ ],
+ },
},
},
},
});
```

#### Divider deprecated props removed

Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#divider-props) below to migrate the code as described in the following sections:
Expand Down
Loading
Loading