I had a hard time trying to find the answer to this on stack overflow so I thought I would write a quick little article in case any one else is having trouble finding the answer to the same thing.
This may not be the best way to do this … but it worked for me 🙌
If you are only needing to conditionally add one class to an element based on the…