跳转到内容

noImportantInKeyframe (since v1.8.0)

Diagnostic Category: lint/nursery/noImportantInKeyframe

Sources:

Disallow invalid !important within keyframe declarations

Using !important within keyframes declarations is completely ignored in some browsers.

@keyframes foo {
from {
opacity: 0;
}
to {
opacity: 1 !important;
}
}
code-block.css:6:18 lint/nursery/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.
  
@keyframes foo {
from {
opacity: 0;
}
to {
opacity: 1;
}
}