Using :has() as a CSS Parent Selector and much more
https://gyazo.com/1be528c97a9f523486a6ba227c30752a
has 親セレクタは Safari が先に実装してる code:figure.html
<figure>
<img src="dog.jpg" alt="black dog smiling in the sun">
<figcaption>Maggie loves being outside off-leash.</figcaption>
</figure>
code:has.css
figure:has(figcaption) {
background: white;
padding: 0.6rem;
}
https://gyazo.com/0af4071e0546b3f282ba00e19d527ca9
form:has(:focus-visible) とかも良さそう
body:has(option[value="foo"]:checked) なるほど
@tkdn: body:has(dialog open ) で backdrop 簡単にいけるやんけ!