Skip to content

keyframe-declaration-no-important

Reports !important in a declaration of a @keyframes rule.

A declaration with !important in a keyframe is ignored, so the property does not animate, and no error tells you.

To fix, delete the !important.

Reported
...
@keyframes k {
from { color: red }
to { color: blue !important }
}
css:
lint:
rules:
keyframe-declaration-no-important: warn # off, warn (default), error
less:
lint:
rules:
keyframe-declaration-no-important: warn # off, warn (default), error
scss:
lint:
rules:
keyframe-declaration-no-important: warn # off, warn (default), error

Enabled by the presets: css/stylelint-recommended.

Suppress one line with sudsy-disable-next-line keyframe-declaration-no-important in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
stylelint keyframe-declaration-no-important full