noValueAtRule
¥Summary
-
规则生效日期:
v1.8.0¥Rule available since:
v1.8.0 -
¥Diagnostic Category:
lint/style/noValueAtRule -
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 information。
¥The default severity of this rule is information.
¥How to configure
{ "linter": { "rules": { "style": { "noValueAtRule": "error" } } }}¥Description
禁止在 css 模块中使用 @value 规则。
¥Disallow use of @value rule in css modules.
建议使用 CSS 变量而不是 @value 规则。
¥Use of CSS variables is recommended instead of @value rule.
¥Examples
¥Invalid
@value red: #FF0000;code-block.css:1:1 lint/style/noValueAtRule ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Use of @value rule is disallowed
> 1 │ @value red: #FF0000;
│ ^^^^^^^^^^^^^^^^^^^^
2 │
ℹ Using @value is not recommended, consider using CSS variables instead.
ℹ See MDN web docs for more details.
¥Valid
:root { --red: #FF0000}
p { background-color: var(--red);}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号