Now that there is CSS Nesting, if I’m using a body-level class for “dark” or “light” mode, I would love to set attributes to a selector that’s deep in the nest by referencing the parent:
body{
.header{
.button{
.image{
background-color: white;
.image::has-parent(.dark-mode){ <-- something like this
background-color: black;
...
I assume this violates some core CSS principles, but I figured I’d ask just in case! Is there an alternative technique for this?