I am importing the svg using the src
attribute in img
element.
For instance: <img src="/images/home.svg" />
I have two kinds of home image. The home.svg which is used in normal situation and homeActive.svg which is used when the home link is active. The two images are completely the same except the color.
Currently, I use an if statement to dynamically display one image over the other. Is there any way that I can just change the color without loading two kind of images.