Please check this, it's working in reverse order (selecting the
.one:has(+ .two) {
background: red;
}
.one:has(+ .two) .one-child {
background: yellow;
}
<div class="one">I am div 1, a target
<p class="one-child"> I am child of one </p>
</div>
<div class="two">I am div 2, a selector </div>