Nice, if you wanna amp it up, then adding a transition to the color changes is a really nice effect, and relatively easy, effect i have seen for these kind of toggles.
(w3schools.com/css/css3_transitions...)
Another way of doing this would be toggling a class with element.classList.
It is a bit more dynamic, and leaves less styling floating in the JS.
(developer.mozilla.org/en-US/docs/W...)
Unless you are into CSS-in-JS but that is a bit more advanced compared to this. :)
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
Nice, if you wanna amp it up, then adding a transition to the color changes is a really nice effect, and relatively easy, effect i have seen for these kind of toggles.
(w3schools.com/css/css3_transitions...)
Another way of doing this would be toggling a class with element.classList.
It is a bit more dynamic, and leaves less styling floating in the JS.
(developer.mozilla.org/en-US/docs/W...)
Unless you are into CSS-in-JS but that is a bit more advanced compared to this. :)