Skip to content

noUnknownPseudoElement

诊断类别:lint/nursery/noUnknownPseudoElement

¥Diagnostic Category: lint/nursery/noUnknownPseudoElement

自从:v1.8.0

¥Since: v1.8.0

来源:

¥Sources:

禁止未知的伪元素选择器。

¥Disallow unknown pseudo-element selectors.

有关已知 CSS 伪元素的详细信息,请参阅 MDN web 文档

¥For details on known CSS pseudo-elements, see the MDN web docs.

此规则忽略供应商前缀的伪元素选择器。

¥This rule ignores vendor-prefixed pseudo-element selectors.

¥Examples

¥Invalid

a::pseudo {}
code-block.css:1:4 lint/nursery/noUnknownPseudoElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected unknown pseudo-elements: pseudo

> 1 │ a::pseudo {}
^^^^^^
2 │

See MDN web docs for more details.

Use a known pseudo-elements instead, such as:

- after
- backdrop
- before
- etc.

a::PSEUDO {}
code-block.css:1:4 lint/nursery/noUnknownPseudoElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected unknown pseudo-elements: PSEUDO

> 1 │ a::PSEUDO {}
^^^^^^
2 │

See MDN web docs for more details.

Use a known pseudo-elements instead, such as:

- after
- backdrop
- before
- etc.

a::element {}
code-block.css:1:4 lint/nursery/noUnknownPseudoElement ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Unexpected unknown pseudo-elements: element

> 1 │ a::element {}
^^^^^^^
2 │

See MDN web docs for more details.

Use a known pseudo-elements instead, such as:

- after
- backdrop
- before
- etc.

¥Valid

a:before {}
a::before {}
::selection {}
input::-moz-placeholder {}

¥Related links