Menu

Instant Dark/light mode Switcher with pure Vanilla JS & CSS
📰

Instant Dark/light mode Switcher with pure Vanilla JS & CSS

DEV Community: css·yomna jarray·about 11 hours ago
#DjlgqbF6
#devtocss#devto#dev#dark#toggle
Reading 0:00
15s threshold

yomna jarray

I built a lightweight, responsive Dark/Light mode toggle component using pure HTML, CSS custom properties, and Vanilla JavaScript.

Features

  • Zero dependencies (no Tailwind, React, or jQuery required).
  • Smooth CSS color transitions.
  • Persistent user preference saved via localStorage. You can grab the full component files and setup instructions for free (or pay-what-you-want): https://yomna67.gumroad.com/l/dark-mode-toggle