Add Dark Mode toggle + Automatic Dark Mode based on prefs + Set Cookie for Casper v4

I created a tutorial on my Ghost blog on how to create the ultimate dark mode experience for Casper v4.

  1. Create a dark mode toggle
  2. Automatic dark mode based on browser preferences
  3. Dark mode “theme” cookie

I have included a “Lazy Guide” for code injection and a “Hard Coded” guide to add to your theme.
Enjoy :slight_smile:

3 Likes

Many thanks for this. I followed the ‘Lazy Guide’ for code injection and it works very well! :slightly_smiling_face:

Nice tutorial :ok_hand: thanks for sharing!