ianmiller347 / feather-icons-react

Feather Icons as a React Component
46 stars 10 forks source link

https://github.com/ianmiller347/feather-icons-react/pulls #8

Closed marquez138 closed 3 years ago

marquez138 commented 5 years ago

Sorry newbie question but how can change the colors for the icons?

ianmiller347 commented 5 years ago

@marquez138 the color is defaulted to be the same color as the text in its container. If you want to control the color, you can set color: rgb(x,x,x) or any color format of choice on the parent div or even on the icon directly.

example on icon directly:

<Icon icon="x" className="color-red" />

example with container div:

// index.js
render() {
  return (
    <div className="color-red">
      <Icon icon="x" />
    </div>
  );
}

and then in your style file:

// style.css
.color-red {
  color: red;
}