csstree / csstree/validator

Invalid Level 3 :not() selectors

Open
#10 1 comment 0 reactions 0 assignees View on GitHub
selector validation
Dominant language
JavaScript
Stars
73
Forks
14
PR merge metrics
No merged PRs in 30d

Description

The level 3 negation pseudo-class only support a *single simple selector* ([ref](https://www.w3.org/TR/2018/CR-selectors-3-20180130/#negation)), so all of the following css selectors *should* return errors (showing as valid in csstree-validator v1.3.1):

```css
.foo:not(li, div) { color: red; }
.foo:not(li.bar) { color: red; }

/* Nestet: https://www.w3.org/TR/2018/CR-selectors-3-20180130/#negation */
.foo:not(:not(li)) { color: red; }
```

From my understanding, `:not(li.bar)` is allowed in [level 4](https://www.w3.org/TR/selectors-4/#negation), but I'm not sure if nested `:not()`s will also be allowed.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.