Combining CSS :has() And HTML For Greater Conditional Styling - Smashing Magazine
Briefly

While CSS :has() targets parents based on content, it can also be used to style elements conditionally like changing styles when a specific <option> in a <select> is selected, no JS needed.
The versatility of :has() extends beyond the usual card components; it excels at handling conditional changes in form controls, making it a valuable tool for styling dynamic content.
Read at Smashing Magazine
[
add
]
[
|
|
]