Limit the number of combinators in a selector.
a > b + c ~ d e { color: pink; }
/** ↑ ↑ ↑ ↑
* These are combinators */
This rule resolves nested selectors before counting the number of combinators selectors. Each selector in a selector list is evaluated separately.
int
: Maximum combinators selectors allowed.
例如,使用 2
:
以下模式被视为违规:
a b ~ c + d {}
a b ~ c {
& > d {}
}
a b {
& ~ c {
& + d {}
}
}
以下模式不被视为违规:
a {}
a b {}
a b ~ c {}
a b {
& ~ c {}
}
/* each selector in a selector list is evaluated separately */
a b,
c > d {}