Skip to content

Files

Latest commit

 

History

History
81 lines (56 loc) · 1.4 KB

selector-not-notation.md

File metadata and controls

81 lines (56 loc) · 1.4 KB

Pattern: Missing simple/complex notation for :not()

Issue: -

Description

Specify simple or complex notation for :not() pseudo-classes.

    a:not(.foo, .bar) {}
/**  ↑
 * This notation */

In Selectors Level 3, only a single simple selector was allowed as the argument to :not(), whereas Selectors Level 4 allows a selector list.

Use:

  • "complex" to author modern Selectors Level 4 CSS
  • "simple" for backwards compatibility with older browsers

Examples

string: "simple"|"complex"

"simple"

The following patterns are considered problems:

:not(a, div) {}
:not(a.foo) {}

The following patterns are not considered problems:

:not(a):not(div) {}
:not(a) {}

"complex"

The following pattern is considered a problem:

:not(a):not(div) {}

The following patterns are not considered problems:

:not(a, div) {}
:not(a.foo) {}
:not(a).foo:not(:empty) {}

Further Reading