I use the font-awesome search icon in my project. Actually, I do it in vue.js. The font-awesome-icon is in the input component and I want to change the color of this icon to yellow when the input is active and what's more - also when there are some already typed text in the input.
<font-awesome-icon :class="isEmpty ? 'white-color' : 'yellow-color'" icon="search" />
Earlier I had css to make this effect, but it didn't handle problem - when some text is already typed, but there is no focus on input. It was like that:
&{
svg {
color: yellow;
}
}