Toggle Dark Mode with CSS :has()

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.

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
1.14.24

Similar items

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Daniel See

6.29.21

Beseda

6.25.21

Ergonomics 101

6.10.21

Twigs Paper

6.10.21

Appart Agency

6.10.21

Welcome to Calvary

6.10.21

Moodboard Cloneable

6.10.21

SkillHub

6.9.21

Pry

6.7.21

Joshua Kaplan

6.3.21

First Session

6.3.21

Custom Media Player Integration with Plyr.io

6.2.21

Marker.io

6.2.21

Galactic Energy

6.2.21

RevenueCat

5.28.21

Wayflyer

5.28.21

ShapeShift

5.26.21

Corebook°

5.25.21

Alex Fisher Design

5.24.21

Base Camp

5.21.21

Mike L. Murphy

5.14.21

JW.S®

5.13.21

Sam George

5.13.21

Material Symbols and Icons - Google Fonts

$99/yr
5.12.21

Mailook

5.10.21

Climate History

5.10.21

Ramp

5.7.21

Durden Pecan

5.7.21

Figure

5.6.21

Really Good Email

5.4.21

Moment

5.3.21

VOUS Church

4.29.21

Inline Merge and Nest Collection Lists

4.29.21

Fern

4.28.21

Tines

4.28.21

BODYGYM

4.28.21

adammade

4.28.21

Prism Data

4.27.21

Aalto

4.27.21

Mighty

4.27.21

Fullwell Leadership

4.22.21

Drink Opus

4.22.21

Deel

4.21.21

Tyler Galpin

4.20.21

Hiro

4.20.21

Peachy Pay

4.20.21

Stacks

4.20.21

Feels

4.16.21

Fiverr Events Hub

4.15.21

Pico

4.14.21

Belpearl Jewelry Collection

4.14.21
Load more

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.