Skip to content

noValueAtRule

¥Summary

¥How to configure

biome.json
{
"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