Skip to content

Commit 09ca90e

Browse files
authored
[material-ui][docs] Document Typography color prop breaking change (#43735)
1 parent a24c124 commit 09ca90e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ You can also manually update your components as shown in the snippet below:
5656
+<Button sx={{ mr: 2 }}>
5757
```
5858

59+
The `sx` prop supports all features of system props: callbacks with access to the theme, responsive values, direct access to theme values, shorthands, etc.
60+
5961
### Theme component variants
6062

6163
Custom component variants defined in the theme are now merged with the theme style overrides, defined within the `root` slot of the component.

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,25 @@ As the `ListItem` no longer supports these props, the class names related to the
360360

361361
In v6, the `children` prop passed to the Loading Button component is now wrapped in a `<span>` tag to avoid [issues](https://github.com/mui/material-ui/issues/27853) when using tools to translate websites.
362362

363+
### Typography
364+
365+
The `color` prop in the `Typography` component is not a [system prop](https://mui.com/system/properties/) anymore. You can use the `sx` prop instead:
366+
367+
```diff
368+
-<Typography color={(theme) => theme.palette.primary.main}>
369+
+<Typography sx={{ color: (theme) => theme.palette.primary.main }}>
370+
```
371+
372+
:::info
373+
System props have been deprecated in favor of the `sx` prop. Check the [migration guide](/material-ui/migration/migrating-from-deprecated-apis/#system-props) for more information.
374+
:::
375+
376+
You still can access some theme colors directly using the `color` prop. Check the [Typography component API page](/material-ui/api/typography/#typography-prop-color) for the whole list of colors.
377+
378+
```jsx
379+
<Typography color="textSecondary">Secondary text</Typography>
380+
```
381+
363382
### useMediaQuery types
364383

365384
The following deprecated types are removed in v6:

0 commit comments

Comments
 (0)