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

Customize icon color with themes #4696

Closed
igorpreston opened this issue Jul 13, 2016 · 6 comments
Closed

Customize icon color with themes #4696

igorpreston opened this issue Jul 13, 2016 · 6 comments
Labels
component: icon button This is the name of the generic UI component, not the React module! component: Icon The React component.

Comments

@igorpreston
Copy link

igorpreston commented Jul 13, 2016

Hi,

Is there a way to customize all FontIcon and IconButton colors using MUI themes? I digged up the code and noticed that FontIcon is bound by textColor property, that's absolutely sad.

Thoughts?

@aahan96
Copy link
Contributor

aahan96 commented Jul 14, 2016

@igorpreston Yes, I looked into the issue and couldn't find any way to change the color of all FontIcon and IconButton components. The only way I could figure out was to change the styles prop wherever you use the components. If you are going down that path, then I would recommend creating a new styling and importing it, rather than creating an object on every page. What do you say?

@igorpreston
Copy link
Author

@aahan96 yes, that's what i've been doing recently as well. I also tried creating HOC to wrap FontIcon and providing custom iconColor variable to the MUi theme, but it is becoming annoying to import decorated FontIcon from local project, rather than from MUI.

MUI themes need definitely to support separate iconColor variable with fallback to textColor, which applies to all FontIcon and IconButton components.

@mpontikes mpontikes mentioned this issue Aug 5, 2016
13 tasks
@jakesamz
Copy link

jakesamz commented Sep 26, 2016

This seems to be more of an Enhancement than a Question.

Any updates on this?

@oliviertassinari
Copy link
Member

I digged up the code and noticed that FontIcon is bound by textColor property

That's right. We would accept a PR to add a fontIcon and iconButton key into getMuiTheme.js.

It is becoming annoying to import decorated FontIcon from local project, rather than from MUI.

That's a pattern we will most likely encourage for the next branch. It's call composition. That sounds right. Still, I agree doing it for the theme sounds overkill.

@oliviertassinari oliviertassinari added component: Icon The React component. component: icon button This is the name of the generic UI component, not the React module! labels Feb 12, 2017
@tgiddings
Copy link

@oliviertassinari can you clarify the intent of closing this issue? Will a convenient way to set icon colors separately from text color only come when v1 is released? Is v1 close enough that solving these issues in v0.x is no longer a concern?

@oliviertassinari
Copy link
Member

@tgiddings The issue was closed by the linked pull request. With the following change, users can override all the styles injected by Material-UI with ease. But even without this change, you should be able to change the color by providing your own CSS.

Is v1 close enough that solving these issues in v0.x is no longer a concern?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: icon button This is the name of the generic UI component, not the React module! component: Icon The React component.
Projects
None yet
Development

No branches or pull requests

5 participants