konradkalemba / tabler-icons-react

🎨 Tabler Icons for React
https://tabler-icons-react.vercel.app
MIT License
198 stars 9 forks source link

Provide a way to set a default color for all icons #13

Closed mcmxcdev closed 1 year ago

mcmxcdev commented 2 years ago

We have business requirements that all icons should use some kind of purple color and you can imagine how tedious this gets when you need to specify it on each icon individually.

Is there a way to set a default color that all icons inherit? Ideally, it should still be overwritable.

konradkalemba commented 2 years ago

This is currently not supported, however all icons have currentColor set as their stroke color by default, so I believe a workaround could be setting a global css rule like so:

svg.icon-tabler {
    color: purple;
}
mcmxcdev commented 1 year ago

Thanks Konrad, I will try that out!