-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Typography] Add system props #24496
Conversation
@material-ui/core: parsed: -0.09% 😍, gzip: -0.07% 😍 |
@@ -288,6 +288,23 @@ export interface CSSOthersObjectForCSSObject { | |||
[propertiesName: string]: CSSInterpolation; | |||
} | |||
|
|||
export type SystemProps = PropsFor< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted so that the typings can be used in both the Box
, Typogrpahy
and the other CSS components we'll introduce.
@@ -16,13 +16,9 @@ const DialogContentTextTest = () => { | |||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the system props are a bit too relaxed and cannot catch these errors :\
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can migrate the usages of the component in the codebase in a different iteration? (Both for Box and Typography)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
classes
and 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 theTypography
component itself. If you still wish to add overrides for them, you can use thetheme.components.MuiTypography.variants
options. For exampleThis PR introduces the system props on the
Typography
component. In order for avoiding breaking changes on thecolor
prop (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. Thedisplay
property was replaced in favor of thedisplay
property of the system, as the behavior should be completely identical.Another iteration on #24485