Skip to content

Commit 9da1516

Browse files
authored
[Tabs][Tab] Remove deprecated CSS classes (#48078)
1 parent 548c594 commit 9da1516

15 files changed

Lines changed: 39 additions & 152 deletions

File tree

docs/data/material/getting-started/templates/dashboard/components/AppNavbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Toolbar = styled(MuiToolbar)({
2121
justifyContent: 'center',
2222
gap: '12px',
2323
flexShrink: 0,
24-
[`& ${tabsClasses.flexContainer}`]: {
24+
[`& ${tabsClasses.list}`]: {
2525
gap: '8px',
2626
p: '8px',
2727
pb: 0,

docs/data/material/getting-started/templates/dashboard/components/AppNavbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Toolbar = styled(MuiToolbar)({
2121
justifyContent: 'center',
2222
gap: '12px',
2323
flexShrink: 0,
24-
[`& ${tabsClasses.flexContainer}`]: {
24+
[`& ${tabsClasses.list}`]: {
2525
gap: '8px',
2626
p: '8px',
2727
pb: 0,

docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,6 +1822,38 @@ The following deprecated props have been removed:
18221822
/>
18231823
```
18241824

1825+
#### Tab deprecated classes removed
1826+
1827+
Use the [tab-classes codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#tab-classes) below to migrate the code as described in the following section:
1828+
1829+
```bash
1830+
npx @mui/codemod@latest deprecations/tab-classes <path>
1831+
```
1832+
1833+
The following deprecated class has been removed:
1834+
1835+
- `iconWrapper` — use the `icon` class instead
1836+
1837+
```diff
1838+
-.MuiTab-iconWrapper
1839+
+.MuiTab-icon
1840+
```
1841+
1842+
#### Tabs deprecated classes removed
1843+
1844+
The following deprecated classes have been removed:
1845+
1846+
- `flexContainer` — use the `list` class instead
1847+
- `flexContainerVertical` — combine the `list` and `vertical` classes instead
1848+
1849+
```diff
1850+
-.MuiTabs-flexContainer
1851+
+.MuiTabs-list
1852+
1853+
-.MuiTabs-flexContainerVertical
1854+
+.MuiTabs-list.MuiTabs-vertical
1855+
```
1856+
18251857
#### ToggleButtonGroup deprecated CSS classes removed
18261858

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

docs/pages/material-ui/api/tab-list.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@
1515
"description": "Styles applied to the tablist element if `!variant=\"scrollable\"`\b\b\b.",
1616
"isGlobal": false
1717
},
18-
{
19-
"key": "flexContainer",
20-
"className": "MuiTabList-flexContainer",
21-
"description": "",
22-
"isGlobal": false,
23-
"isDeprecated": true
24-
},
25-
{
26-
"key": "flexContainerVertical",
27-
"className": "MuiTabList-flexContainerVertical",
28-
"description": "",
29-
"isGlobal": false,
30-
"isDeprecated": true
31-
},
3218
{
3319
"key": "hideScrollbar",
3420
"className": "MuiTabList-hideScrollbar",

docs/pages/material-ui/api/tab.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@
4545
"description": "Styles applied to the `icon` HTML element if both `icon` and `label` are provided.",
4646
"isGlobal": false
4747
},
48-
{
49-
"key": "iconWrapper",
50-
"className": "MuiTab-iconWrapper",
51-
"description": "Styles applied to the `icon` HTML element if both `icon` and `label` are provided.",
52-
"isGlobal": false,
53-
"isDeprecated": true
54-
},
5548
{
5649
"key": "labelIcon",
5750
"className": "MuiTab-labelIcon",

docs/pages/material-ui/api/tabs.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,20 +134,6 @@
134134
"description": "Styles applied to the tablist element if `!variant=\"scrollable\"`\b\b\b.",
135135
"isGlobal": false
136136
},
137-
{
138-
"key": "flexContainer",
139-
"className": "MuiTabs-flexContainer",
140-
"description": "",
141-
"isGlobal": false,
142-
"isDeprecated": true
143-
},
144-
{
145-
"key": "flexContainerVertical",
146-
"className": "MuiTabs-flexContainerVertical",
147-
"description": "",
148-
"isGlobal": false,
149-
"isDeprecated": true
150-
},
151137
{
152138
"key": "hideScrollbar",
153139
"className": "MuiTabs-hideScrollbar",

docs/translations/api-docs/tab-list/tab-list.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@
1414
"nodeName": "the tablist element",
1515
"conditions": "<code>!variant=\"scrollable\"</code>\b\b\b"
1616
},
17-
"flexContainer": {
18-
"description": "",
19-
"deprecationInfo": "use <code>list</code> instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
20-
},
21-
"flexContainerVertical": {
22-
"description": "",
23-
"deprecationInfo": "use a combination of <code>list</code> and <code>vertical</code> instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
24-
},
2517
"hideScrollbar": {
2618
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
2719
"nodeName": "the tablist element",

docs/translations/api-docs/tab/tab.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@
4141
"nodeName": "the <code>icon</code> HTML element",
4242
"conditions": "both <code>icon</code> and <code>label</code> are provided"
4343
},
44-
"iconWrapper": {
45-
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
46-
"nodeName": "the <code>icon</code> HTML element",
47-
"conditions": "both <code>icon</code> and <code>label</code> are provided",
48-
"deprecationInfo": "Use <code>icon</code> class instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details"
49-
},
5044
"labelIcon": {
5145
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
5246
"nodeName": "the root element",

docs/translations/api-docs/tabs/tabs.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@
6464
"nodeName": "the tablist element",
6565
"conditions": "<code>!variant=\"scrollable\"</code>\b\b\b"
6666
},
67-
"flexContainer": {
68-
"description": "",
69-
"deprecationInfo": "use <code>list</code> instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
70-
},
71-
"flexContainerVertical": {
72-
"description": "",
73-
"deprecationInfo": "use a combination of <code>list</code> and <code>vertical</code> instead. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
74-
},
7567
"hideScrollbar": {
7668
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
7769
"nodeName": "the tablist element",

packages/mui-material/src/Tab/Tab.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const useUtilityClasses = (ownerState) => {
2424
selected && 'selected',
2525
disabled && 'disabled',
2626
],
27-
icon: ['iconWrapper', 'icon'],
27+
icon: ['icon'],
2828
};
2929

3030
return composeClasses(slots, getTabUtilityClass, classes);
@@ -42,9 +42,6 @@ const TabRoot = styled(ButtonBase, {
4242
styles[`textColor${capitalize(ownerState.textColor)}`],
4343
ownerState.fullWidth && styles.fullWidth,
4444
ownerState.wrapped && styles.wrapped,
45-
{
46-
[`& .${tabClasses.iconWrapper}`]: styles.iconWrapper,
47-
},
4845
{
4946
[`& .${tabClasses.icon}`]: styles.icon,
5047
},

0 commit comments

Comments
 (0)