Re: [csswg-drafts] [selectors] :visible pseudo-class for targeting only visible elements (#5827)

How do you avoid cycles?

```css
:visible { display: none }
```

And BTW, `:first-child:visible` would match the first child *if* it's visible, instead of the first visible child. That would be `:nth-child(1 of :visible)`.

> this is extremely useful for situations where a script or style tag might appear first in the DOM but is not visible to the user.

I think it would be easier to cover this usecase with a `:metadata` pseudo-class, matching [metadata content](https://html.spec.whatwg.org/#metadata-content-2): `base`, `link`, `meta`, `noscript`, `script`, `style`, `template`, `title`. But I'm not convinced this is worth it.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5827#issuecomment-752157431 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 29 December 2020 16:54:25 UTC