This rule reports a @custom-variant selector without &. Without &, the
selector matches descendants of the element, not the element itself. In the
example, hocus: would match hovered elements inside the element.
Reported
@custom-variant hocus (:hover);implicit-nesting-selector: variant selector `:hover` is relative to `&` and means `& :hover`; write the `&`, or add `scope(document)` to the definition to select a document-level elementFixed
@custom-variant hocus (&:hover);How to fix
- Add
&where the element belongs in the selector, as in the example. - If the variant should match descendants, write that explicitly, such as
(& :hover).
Rule settings
| Preset | Severity |
|---|---|
recommended | warn |
strict | deny |
stylistic | off |
Configure lint to change the severity or options.