:not(.thing) { color: red; } :not(.thing[disabled]) { @extend .thing; background: blue; } :has(:not(.thing[disabled])) { @extend .thing; background: blue; }