Learn how to create a dark mode with less than 10 lines of JavaScript. If you want to make the dark mode persistent, I show you how to utilize the user's local browser storage to keep that setting. That way when the user comes back to the site their last choice (dark or light) can be applied. As a bonus, I also show you how to add a nice fade transition between modes.
Code on Codepen
https://codepen.io/brianhaferkamp/pen...
Like this video? Please give it a thumbs up!
Connect with me on Twitter
/ brianhaferkamp (@brianhaferkamp)