I am trying to apply a class to an element based on parent width. I tried the approach mentioned here but it didn't work.
<div>
<div className="test-border">test</div>
</div>
.test-red[min-width~="10px"] {
background-color: rgb(247, 0, 0);
}
So what I tried to achieve there is to make the background red if the parent element width is > 10 px.
But, this seems to have no impact whatsoever.
NOTE: There are similar questions but none of them provide satisfying answers.