noImportantInKeyframe
¥Summary
-
规则生效日期:
v1.8.0¥Rule available since:
v1.8.0 -
诊断类别:
lint/suspicious/noImportantInKeyframe¥Diagnostic Category:
lint/suspicious/noImportantInKeyframe -
此规则为推荐规则,默认启用。
¥This rule is recommended, which means is enabled by default.
-
此规则没有修复方案。
¥This rule doesn’t have a fix.
-
此规则的默认严重级别为 error。
¥The default severity of this rule is error.
-
来源:
¥Sources:
¥How to configure
{ "linter": { "rules": { "suspicious": { "noImportantInKeyframe": "error" } } }}¥Description
禁止在关键帧声明中允许无效的 !important
¥Disallow invalid !important within keyframe declarations
在某些浏览器中,在关键帧声明中使用 !important 会被完全忽略。
¥Using !important within keyframes declarations is completely ignored in some browsers.
¥Examples
¥Invalid
@keyframes foo { from { opacity: 0; } to { opacity: 1 !important; }}code-block.css:6:18 lint/suspicious/noImportantInKeyframe ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Using !important within keyframes declaration is completely ignored in some browsers.
4 │ }
5 │ to {
> 6 │ opacity: 1 !important;
│ ^^^^^^^^^^
7 │ }
8 │ }
ℹ Consider removing useless !important declaration.
¥Valid
@keyframes foo { from { opacity: 0; } to { opacity: 1; }}¥Related links
Biome v2.1 中文网 - 粤ICP备13048890号