Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 771 Bytes

File metadata and controls

47 lines (32 loc) · 771 Bytes

selector-pseudo-element-whitelist

Specify a whitelist of allowed pseudo-element selectors.

 a::before {}
/** ↑
 * These pseudo-element selectors */

This rule ignores CSS2 pseudo-elements i.e. those prefixed with a single colon.

This rule ignores selectors that use variable interpolation e.g. ::#{$variable} {}.

Options

array|string|regex: ["array", "of", "unprefixed", "pseudo-elements" or "regex"]|"pseudo-element"|/regex/

Given:

["before", "/^my-/i"]

The following patterns are considered violations:

a::after {}
a::not-my-pseudo-element {}

The following patterns are not considered violations:

a::before {}
a::my-pseudo-element {}
a::MY-OTHER-pseudo-element {}