-
-
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
Icon component can't receive custom theme colors #27831
Comments
Hi Ben, |
Hey Jorge,
That was the best work-around I came up with for now as well.
And I assumed that “string” in the prop options there meant any custom
string? 🤷♂️
- Benjamin
…On Thu, 19 Aug 2021 at 4:40 am, Jorge Alves ***@***.***> wrote:
Hi Ben,
While I wasn't able to find out why this is happening ( and I would love
to know why ) I found a workaround that could be an easy fix for , and a
guidance to why this might be happening to someone more experiences in MUI
that might see this.
https://codesandbox.io/s/material-ui-v5-icons-custom-color-bug-forked-jswdn?file=/demo.js
By using "warning" which is one of the listed values for the color prop
for the SvgIcon , you can now use it as your custom color palette.
[image: image]
<https://user-images.githubusercontent.com/60895482/129969106-3c16790c-5ef1-4b64-ad80-10302e8b9771.png>
Interestingly enough , IconButton api doesn't reference any "custom
values" yet it works in that . Go Figure.
Hope this helps!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#27831 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO7XHSE3K2RO2E6YNXVBTNLT5QLE7ANCNFSM5CMDPTEQ>
.
|
Current Behavior 😯
Icon
component can't receive custom theme colors, while Buttons and IconButtons can.Expected Behavior 🤔
Icon
component can receive custom colors from the theme, just like Buttons and IconButtons can.Steps to Reproduce 🕹
CodeSandbox
Steps:
Context 🔦
Trying to custom style Icons and Button start/endIcons without them being IconButtons.
Your Environment 🌎
`npx @material-ui/envinfo`
This behaves the same on Firefox and Chrome (haven't checked Safari or Edge) and Codesandbox...
🙏🙏🙏
The text was updated successfully, but these errors were encountered: