danawoodman / react-fontawesome

A React Font Awesome component.
https://www.npmjs.com/package/react-fontawesome
MIT License
668 stars 72 forks source link

How to specify the color of the icon? Looks like it's impossible... #81

Closed Muzietto closed 5 years ago

Muzietto commented 5 years ago

I have been trying to change the drawing color of an icon, without success, e.g.

  <FontAwesomeIcon
    color='red'
    icon={faIcon}
    size='1x'
  />

Now I see at https://github.com/danawoodman/react-fontawesome/blob/HEAD/api.md that the component API does not seem to include "color", so I try:

  <FontAwesomeIcon
    style={{color: 'red'}}
    icon={faIcon}
    size='1x'
  />

Still it does not work. Is there a way to specify the icon color?

danawoodman commented 5 years ago

That is strange, there is no reason style should not work since we pass down all props to the component. Have you looked at the component in the inspector to make sure it is not being overridden elsewhere?

And yes, we do no provide a color prop.

PS, If you're using this with FontAwesome 5, you should use their official React component

danawoodman commented 5 years ago

Please reopen if you believe this is an issue