CSS Has Power
Link
Message thread
Matthias Zöchling wrote on
I’ve said it before, and I’ll say it again, the power of :has()
cannot be underestimated. Check out this @smashingmag article:
www.smashingmagazine.com/2024/05/[…]-conditional-styling
Matthias Zöchling wrote on
Regarding conditional styling, I used :has()
to query meta[name="color-scheme"]
not too long ago. /cc @amit_sheen 🙃
cssence.com/2024/color-scheme-switcher
Amit Sheen wrote on
In reply to: @CSSence.
Nice!
Same principle I used. 🙃
It’s fun that you can now also use <select>
for conditional styling.
great job.
Matthias Zöchling wrote on
Thanks, in my case the <select>
is just an intermediary. I’ll use it to update the meta tag for color-scheme via JS, and then rely on user agent styles for light/dark mode. 😉
Get involved
Comments are closed, but feel free to share this thread.