Skip to content

keyframe-block-no-duplicate-selectors

Reports a selector that is used twice in one @keyframes rule (from and FROM count as the same, names are compared in lowercase).

Keyframes with the same offset are merged by the browser in order, and the later declarations win for the same property. The animation then differs from what the first block says.

To fix, merge the two blocks.

Reported
...
@media print { a { color: red } }
@keyframes k { from { top: 0 } FROM { top: 1px } 0% { top: 2px } }
css:
lint:
rules:
keyframe-block-no-duplicate-selectors: warn # off, warn (default), error
less:
lint:
rules:
keyframe-block-no-duplicate-selectors: warn # off, warn (default), error
scss:
lint:
rules:
keyframe-block-no-duplicate-selectors: warn # off, warn (default), error

Enabled by the presets: css/stylelint-recommended.

Suppress one line with sudsy-disable-next-line keyframe-block-no-duplicate-selectors 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-block-no-duplicate-selectors full