-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[SvgIcon] color prop do not recognize "success" and "warning" #26644
Comments
It doesn't look like this bug report has enough info for one of us to reproduce it. Please provide a CodeSandbox (https://material-ui.com/r/issue-template-next), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve |
I thought this issue is obvious enough so I didn't provide a code sandbox link. Anyway here it is: |
Thanks for the repro. <Search color="success" />
<Search color="warning" />
<Search color="info" /> These colors are not supported by default. Hence the TypeScript error. Why do you think these colors are supported by default? You probably want to add these colors to begin with: https://next--material-ui.netlify.app/customization/palette/#adding-new-colors
We have 10-20 issues a day. Everytime an "obvious" issue is opened we still need to spend 5 minutes to reproduce it. That's 50-100 minutes a day on "obvious" issues. Now some of these aren't obvious and we need to be careful not to spend more time. This is time that can be saved for maintainers which we explicitly ask for in the issue template. Generally, if a maintainer asks something, following that does help us more than making educated guesses. Even if these are reasonable. |
What do you mean? Those colors are standard in the theme created using That's why I'm confused. Why the prop validation allows |
That doesn't mean they're available on every component.
We no longer verify valid color tokens since these might be customized. We rely on static type-checking via TypeScript. |
Closing in favor of #26192 which should cover this issue as well. |
Current Behavior 😯
The title is pretty self-explanatory. The
SvgIcon
component uses the default color when settingcolor="success"
andcolor="warning"
(I expect the same applies toinfo
and custom color palette as well).Expected Behavior 🤔
It should turn into the corresponding color (typically green and yellow respectively).
Steps to Reproduce 🕹
Steps:
Use any icons from
@material-ui/icon@next
orSvgIcon
from@material-ui/core@next
Context 🔦
I can't think of any reasons why
error
would work onSvgIcon
whilewarning
andsuccess
do not.Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: