selector-pseudo-element-no-unknown
Disallow unknown pseudo-element selectors.
a::before {}/** ↑ * This pseudo-element selector */Use this rule to avoid mistyped pseudo-elements, e.g. ::befor. Browsers ignore the whole rule, as an unknown pseudo-element invalidates the selector.
This rule considers pseudo-element selectors defined in the CSS Specifications, up to and including Editor’s Drafts, to be known.
This rule ignores vendor-prefixed pseudo-element selectors.
This rule supports 1 message argument: the unknown pseudo-element.
Options
Section titled “Options”{ "selector-pseudo-element-no-unknown": true}The following patterns are considered problems:
a::pseudo {}a::PSEUDO {}a::element {}The following patterns are not considered problems:
a:before {}a::before {}::selection {}input::-moz-placeholder {}Optional secondary options
Section titled “Optional secondary options”ignorePseudoElements
Section titled “ignorePseudoElements”{ "ignorePseudoElements": ["array", "of", "pseudo-elements", "/regex/"] }Given:
{ "selector-pseudo-element-no-unknown": [ true, { "ignorePseudoElements": ["/^--my-/", "--pseudo-element"] } ]}The following patterns are not considered problems:
a::--my-pseudo {}a::--my-other-pseudo {}a::--pseudo-element {}