I have a complex website with multiple containers. My objective is to apply a color to a container with the class "colorme" when another container, located far away from it, has the class "active". Here is how the code is structured:
.tooltip:has(tooltip > div.active)~main-view>div.colorme {
background: orange
}
<div class="tooltip">
<tooltip>
<div class="active">
My tooltip is active
</div>
</tooltip>
</div>
<div class="othercontainer">
</div>
<main-view>
<div class="colorme">
Test
</div>
</main-view>
My goal is to change the background color of the colorme
div as soon as the <tooltip>
tag contains a container with the class active
. While I'm unsure if this can be achieved, I believe this structure might help in implementing it.