#selector-pseudo-class-whitelist

指定允许的伪类选择器的白名单。

  a:hover {}
/** ↑
 * 这个伪类选择器 */

此规则忽略使用变量插值的选择器,例如 :#{$variable} {}

#选项

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

如果字符串用 "/" 包围(例如 "/^nth-/"),则将其解释为正则表达式。这允许方便的简写,例如:/^nth-/ 将匹配 nth-childnth-last-childnth-of-type 等。

给定:

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

以下模式被视为违规:

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

以下模式被视为违规:

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