csstree / validator

CSS validator based on CSSTree
MIT License
65 stars 14 forks source link

Invalid Level 3 :not() selectors #10

Open Mottie opened 6 years ago

Mottie commented 6 years ago

The level 3 negation pseudo-class only support a single simple selector (ref), so all of the following css selectors should return errors (showing as valid in csstree-validator v1.3.1):

.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, but I'm not sure if nested :not()s will also be allowed.

lahmatiy commented 6 years ago

Validator doesn't validate selectors for correctness at the moment. Anyway, the level 4 allows a selector list as an argument for :not() and Safari already supports it. L4 also doesn't limit nesting and nested :not() works in Safari as well.