4
I’m using the Fontawesome in the React and to change the color of an icon you need to change the color in the icon class. See an example below:
.fa-drash{
color: #ff0000;
}
The bottom follows the way it is today, but every time I include a new icon in the application, I have to update the style sheet.
.fa-drash, fa-ed, .fa-adjust, .fa-acorn, .fa-alarm, .fa-amazon, .fa-apple, .fa-appter{
color: #ff0000;
}
My thought would be to improve this by inserting only the initials of the class .fa-
, as for example below, but it did not work with me:
.fa-*{
color: #ff0000;
}
It is possible to style classes started with .fa-
? Yes yes, as?
I do not recommend styling directly the "fa" class. I would advise you to create a class of your own, for example "my-icon" and style it with your "default" settings. To the extent necessary, you just assign this new class to the icons you want to inherit these properties.
– Leandro Castro