1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-25 06:45:34 +00:00
notes/node_modules/stylelint/lib/rules/selector-pseudo-class-whitelist
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
index.js Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00

selector-pseudo-class-whitelist

Specify a whitelist of allowed pseudo-class selectors.

  a:hover {}
/** ↑
 * These pseudo-class selectors */

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

Options

array|string|regex: ["array", "of", "unprefixed", "pseudo-classes" or "regex"]|"pseudo-class"|/regex/

If a string is surrounded with "/" (e.g. "/^nth-/"), it is interpreted as a regular expression. This allows, for example, easy targeting of shorthands: /^nth-/ will match nth-child, nth-last-child, nth-of-type, etc.

Given:

["hover", "/^nth-/"]

The following patterns are considered warnings:

a:focus {}
a:first-of-type {}

The following patterns are not considered warnings:

a:hover {}
a:nth-of-type(5) {}
a:nth-child(2) {}