If your only option is to change background-image
like mine, this is what worked for me:
- From fontawesome's webpage, click the icon, select
svg
and copy.
- Fontawesome icons don't have color, you need to change the color as explained here: How can I change the color of an 'svg' element?
- Now your problem is "how to use an svg as a background-image, which is neatly explained here: Using SVG as background image
then you can just use something like below:
.my-class {
background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3....");
}
This worked like a charm!