Using :has() as a CSS Parent Selector and much more
https://gyazo.com/1be528c97a9f523486a6ba227c30752a
Using :has() as a CSS Parent Selector and much more | WebKit
has 親セレクタは Safari が先に実装してる
:has() Demo #1 — Figure variations
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
:has() Demo #4 — Form fields
form:has(:focus-visible) とかも良さそう
:has() Demo #5 — Theme picker via Select
body:has(option[value="foo"]:checked) なるほど
@tkdn: body:has(dialog open ) で backdrop 簡単にいけるやんけ!
https://t.co/IUcdLZKLna