If an element doesn't have a certain parent element, I want to change the style of that element without having to overwrite it to its original value.
See https://jsfiddle.net/xqb2z8tc/ The problem with the above code is that due to the heavy use of mixins, it generates a lot of css, so we want to rewrite it. I thought about using the ':has()' selector (browser support is fine for us), but I don't know how.
Similar to the code below, but it should work in all cases, see the jsfiddle above.
.dark-view:not(:has(.obox)) p { color: white; }
Based on my interpretation of the question, it looks like you want to apply
color: #fff
to all
is not
.dark- viewelements in
.obox
Descendants of the element. If this is the case, consider using the selector.dark-view p:not(.obox *)
: