-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[system] Add typography prop that will pull from theme.typography #23451
Conversation
Are we should we want to overload the shorthand |
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.
Are we should we want to overload the shorthand font CSS property? This would mean that sx is no longer a CSS superset.
@eps1lon From what I understand, it's similar to padding: 1
. If the font
has a value that matches the theme, then it gets precedence over the actual value. So both font: 'body1'
and font: '1.2em "Fira Sans", sans-serif;'
works.
So it's not actually a superset. We should stop calling it a superset then. |
@eps1lon Do you have an example of a value that is supported by CSS that isn't by the system? (a counter example that proves that it's not a superset) |
If there is a concern with font as it is a CSS property we could use typography as key instead. But, as the prop can behave as css property if the value is css value, I don’t see a big problem to be honest. |
"superset" is a well-known and defined term which helps understand a particular issue by putting constraints in place. We shouldn't use that term with a custom interpretation. Otherwise it has an adverse effect on learning |
This is a very good corner case, thanks for pointing it out. I believe we can change this prop then to |
Do we miss a demo for https://next.material-ui.com/system/typography/? |
Note: It's best to hide whitespace changes when reviewing - https://github.com/mui-org/material-ui/pull/23451/files?diff=split&w=1
This PR adds support for
font
prop as part of the system's typography that will pull the values defined in thetheme.typography
. It should simplify scenarios for pulling all values defined for a typography variant. For example:Fixes #23190
Fixes #17504