In the "Design Pattern List" Post, you can find a categorized list of design patterns in software engineering. In some upcoming posts, I plan to co...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
Appreciate the sentiment here having to try and clean up an e-commerce front end theme that the Dev has utilised your exact example of adding and removing classes with js. It's horrible checking through various states to see what classes are being added removed at any point in time, couple this with different breakpoints and media queries being used it's a nightmare.
I learnt a few rough lessons in js around mutation of variables and the mess you can get into. I feel as though messing with classes can actually lead you down the same path. I like the data attribute idea, you can clearly see what is being targeted and it's before / after state options.
Сongratulations 🥳! Your article hit the top posts for the week - dev.to/fruntend/top-10-posts-for-f...
Keep it up 👍