👋🏻 Hi, I'm Ryan! I am a Web Developer, Streamer, and Blogger transitioning careers into Full-Stack Web Development. Currently I enjoy working with React/NextJS, Astro, and Tailwind CSS.
The only benefit would be that you don't have to remove the old class simple override the dataset.
The main advantage of this method is that you don't need to change classes in several places. Simply change the dataset, or class if you prefer, on the body and everything else follows automatically.
👋🏻 Hi, I'm Ryan! I am a Web Developer, Streamer, and Blogger transitioning careers into Full-Stack Web Development. Currently I enjoy working with React/NextJS, Astro, and Tailwind CSS.
What is the benefit of using dataset rather than a class?
The only benefit would be that you don't have to remove the old class simple override the dataset.
The main advantage of this method is that you don't need to change classes in several places. Simply change the dataset, or class if you prefer, on the body and everything else follows automatically.
I see! Interesting - I'm still (obviously) a novice in JS and definitely want to look more into this.
Thanks so much for reading and commenting, Andrew!