[Typography] Add system props#24496
Conversation
|
@material-ui/core: parsed: -0.09% 😍, gzip: -0.07% 😍 |
| [propertiesName: string]: CSSInterpolation; | ||
| } | ||
|
|
||
| export type SystemProps = PropsFor< |
There was a problem hiding this comment.
Extracted so that the typings can be used in both the Box, Typogrpahy and the other CSS components we'll introduce.
| <DialogContentText align="inherit" color="textPrimary" /> | ||
| <DialogContentText align="inherit" color="textSecondary" /> | ||
| <DialogContentText align="inherit" color="error" /> | ||
| {/* @ts-expect-error */} |
There was a problem hiding this comment.
Seems like the system props are a bit too relaxed and cannot catch these errors :\
Definitelly, didn't want to do all those changes in just one PR :) |
| 'textPrimary', | ||
| 'textSecondary', | ||
| ]), | ||
| color: PropTypes /* @typescript-to-proptypes-ignore */.any, |
There was a problem hiding this comment.
|
I don't understand why this started failing now - https://app.circleci.com/pipelines/github/mui-org/material-ui/36615/workflows/0ea8cae7-7ee2-4350-881b-06df6d568b69/jobs/217634 it's related to the typings of the |
@oliviertassinari @eps1lon I could use some help here. I spend 40 mins trying to understand what is happening but with no success 😞 |
|
Looking at it right now |
|
I can't find any mention of what the plan for the Typography is extended by a lot of other components so just changing how |
I should have explained the breaking changes for the classes in the PR description, my bad will do it. Regarding the |
|
The autocomplete for the previously known
|
Co-authored-by: Olivier Tassinari <[email protected]>
50a84c3 to
659b8ea
Compare
BREAKING CHANGES
The following
classesand style overrides keys were removed: "colorInherit", "colorPrimary", "colorSecondary", "colorTextPrimary", "colorTextSecondary", "colorError", "displayInline" and "displayBlock". These props are now considered part of the system, not on theTypographycomponent itself. If you still wish to add overrides for them, you can use thetheme.components.MuiTypography.variantsoptions. For exampleconst theme = createMuiTheme({ components: { MuiTypography: { - styleOverrides: { - colorSecondary: { - marginTop: '20px', - }, - }, + variants: { + props: { color: "secondary" }, + style: { + marginTop: '20px', + }, + }], }, }, });This PR introduces the system props on the
Typographycomponent. In order for avoiding breaking changes on thecolorprop (which existed before on the component and is part of the system), the previous values are still supported in addition to the system values that the color prop can have. Thedisplayproperty was replaced in favor of thedisplayproperty of the system, as the behavior should be completely identical.Another iteration on #24485