Hey, I wouldn't suggest this method for a couple reasons:
CSS in JS is a valid thing, but I would use a library built for that so that your code is more performant and follows best practices!
Hi Ali, Dirk,
JS is good for doing the extra mile, please use CSS for the things it was intended. We can even make animations and transitions with CSS today!
Good luck :)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.