Designer
CMS
Ecommerce
Interactions
Memberships
Editor
Logic
SEO
Hosting
Security
Overview
Libraries
Apps
Hire a Certified Partner
Templates
Made in Webflow
Learn
Community
Ebooks
Forum
Blog
Support
LoginContact Sales
Get started — it's free
Made in Webflow

CSS only dark mode toggle with the :has() selector

Web Bae's avatar
Web Bae
Clone in Webflow264
site profile thumbnail
Open in Webflow
Open live site
The CSS :has() selector can be used to toggle dark mode, light mode, and themes with zero Javascript, just HTML and CSS. :has() finally arrived in all major browsers, having dropped in Firefox December 2023.
Open in Webflow
Open live site
css
darkmode
darktheme
toggle
darkmodetoggle
customcode
lightdarkmodetoggle
lightmodetoggle
togglebutton
toggleswitch
checkbox

More sites by Web Bae

See profile
The Greatest Infinite Marquee (HTML + CSS only)
806
8k
Moving Gradient Background
620
3.9k
Award Winning Grid Trail Mouse Follow Effect
467
1.3k

Similar sites

Frank Za
FZ
Errorlog 02
1
0
Frank Za
author avatar
Modifying the styles of symbols with the :has() selector
3
4
Sam Pilgrim
author avatar
Light / dark mode toggle that persists using custom JavaScript
9
44
Lionize
author avatar
Illuminate Toggle - Dark/Light mode
31
125
Jim Ebbelaar
author avatar
Responsiveness Checker | Template Theme Selector
6
23
Sami Rehman
author avatar
Dark/Light mode toggle button
11
222
Carlos Ruiz del Vizo
Explore
  • Dashboard
  • Marketplace
  • Hire designers
Learn & get help
  • Support
  • University
  • Courses
  • Blog
  • Ebooks
  • Forum
  • Community
  • Developers
  • Wishlist
  • Status
Company
  • About
  • Careers
  • Sitemap
  • Become an Affiliate
Terms & policy
  • Terms of Service
  • Privacy policy
  • Cookie policy
Social
Social
Explore
  • Dashboard
  • Marketplace
  • Hire designers
Learn & get help
  • Support
  • University
  • Courses
  • Blog
  • Ebooks
  • Forum
  • Community
  • Developers
  • Wishlist
  • Status
Company
  • About
  • Careers
  • Sitemap
  • Become an Affiliate
Terms & policy
  • Terms of Service
  • Privacy policy
  • Cookie policy
Social
Social