Skip to content
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] color prop is not documented but it works #32269

Open
socketpair opened this issue Apr 12, 2022 · 10 comments
Open

[Typography] color prop is not documented but it works #32269

socketpair opened this issue Apr 12, 2022 · 10 comments
Labels
component: Typography The React component. docs Improvements or additions to the documentation

Comments

@socketpair
Copy link

socketpair commented Apr 12, 2022

https://mui.com/material-ui/api/typography/

color= property is missing.

For example, color="primary" and color="primary.dark" both work as expected.

@socketpair socketpair added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 12, 2022
@danilo-leal danilo-leal changed the title <Typography color="...." > is not documented, but works. [Typography] color prop is not documented but it works Apr 12, 2022
@danilo-leal danilo-leal added component: Typography The React component. docs Improvements or additions to the documentation and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 12, 2022
@danilo-leal
Copy link
Contributor

Hey @socketpair, thanks for the heads up! Do you want to open a PR for it?!

@hbjORbj
Copy link
Member

hbjORbj commented Apr 13, 2022

If we decide to document color prop, we will need to document all of these system properties.

I presume that is why we inserted this explanation instead:

As a CSS utility, the Typography component also supports all system properties. You can use them as props directly on the component.

@socketpair
Copy link
Author

It would much more noticeable if the phrase about system props can be inserted in the table. like this:

image

If you are agree, I think it should be changed in all other places where system props are mentioned

@danilo-leal
Copy link
Contributor

Thanks for the heads up @hbjORbj! I think @socketpair's suggestion is indeed a clearer way to transmit this information!

@hbjORbj
Copy link
Member

hbjORbj commented Apr 13, 2022

I agree! Will you be willing to work on this? @socketpair

@socketpair
Copy link
Author

I think yes.

@socketpair
Copy link
Author

@hbjORbj Sorry, I can't :(

@Baribj
Copy link

Baribj commented Jul 28, 2022

Definitely agree with @socketpair, this confused me for a good little while.

@zavarka
Copy link

zavarka commented Aug 29, 2022

Just wanted to add that, currently, TypeScript is not aware that you can pass the colors defined in the theme. The following values are not listed in the auto-completion suggestions:

primary
primary.main
textPrimary
text.primary
secondary
secondary.main
textSecondary
text.secondary
error
error.main

It would be helpful to have these included in the color prop type.

@emlai
Copy link
Contributor

emlai commented Sep 12, 2022

It's also weird that error color works, but not warning, success, etc. (PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Typography The React component. docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

6 participants