Toggle Dark Mode with CSS :has()
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.
Tags
Creator
Share this item
Have feedback or a question related to this item? Drop us some feedback!
Curated:
1.15.24
Subscribe for updates
Get updates on the latest curated resources and be the first to hear of new features.
SubscribeStyle, type, and motion in harmony, architectural web glory, AI your brand
When AI becomes your copilot, make sure you still know how to fly the plane.
Featured inspo
Refero Styles
Daniel Sun
21Oaks
Artemii Lebedev