The Quest for the Perfect Dark Mode Toggle, using Vanilla JavaScript

In The Quest for the Perfect Dark Mode, Joshua W Comeau extensively explains how he has implemented the Dark Mode Toggle on his Gatsby-powered website. It follows the system’s light/dark mode preference, but also allows for an override which he persists in localStorage. The flow to decide if Dark Mode should be used or not …

Echochamber.js – All of the commenting, none of the comments.

echochamber.js is a third-party script you can install to add a simple comment form to your blog post or website. Nothing new, right? Wrong! There’s a rather cunning twist: When a user submits a comment, echochamber.js will save the comment to the user’s LocalStorage, so when they return to the page, they can be confident …

The case against localStorage

Christian Heilmann on localStorage: We have to stop advocating localStorage as a great opportunity for storing data as it performs badly. Sadly enough the alternatives are not nearly as supported or simple to implement. There is no simple solution for local storage → Related: Web Storage Introduction →