-
-
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
[Joy] Add Typography
component
#30489
Conversation
@mui/joy: parsed: +2.24% , gzip: +2.04% |
}, | ||
})<{ ownerState: TypographyProps }>(({ theme, ownerState }) => ({ | ||
margin: 0, | ||
// TODO: remove in the next major version |
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.
What next version do these TODOs refer to? As we're building the first version, we can introduce breaking changes (vs material) now, can't we?
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.
Yeah, I also doubt my initial thought. @danilo-leal What do you think? should we go with only level
prop or leave it like this and revisit again before the official release?
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.
It doesn't make too much sense to me to maintain @mui/material
props in any Joy component for the sake of ease of transition. They're meant to be different things with different stakes/trade-offs (at least at some levels), so I'd go for breaking away from Material when appropriate from the get-go.
inherit: 'p', | ||
}; | ||
|
||
const Typography = React.forwardRef(function Typography(inProps, ref) { |
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.
Side note: I'm wondering why don't we just call it Text
- it's much shorter to type :)
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 want to change the component name at this point but I think @oliviertassinari can explain the history of "Typography".
Co-authored-by: Michał Dudak <michal.dudak@gmail.com> Co-authored-by: Benny Joo <sldisek783@gmail.com>
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.
Love it 😀
Summary
Mostly replicate material Typography component with some deprecations:
variant
to uselevel
prop instead (variant has another meaning in Joy)align
andparagraph
prop because ofsx
prop.The intention of deprecation instead of removing is to ease people who are familiar with
material
(To be honest, I am a bit reluctant about this decision, waiting to see the team's thought)