Skip to content

keyframe-selector-notation

Reports from and to in a @keyframes that also uses percentages. A block with nothing but keywords is not reported.

from is 0% and to is 100%, so mixing the forms in one animation makes the reader translate. With percentages the animation reads as a timeline.

To fix, write 0% and 100%.

Reported
...
@keyframes k { from { top: 0 } to { top: 1px } }
@keyframes j { from { top: 0 } 50% { top: 1px } to { top: 2px } }
After the fix
...
@keyframes k { from { top: 0 } to { top: 1px } }
@keyframes j { from { top: 0 } 50% { top: 1px } to { top: 2px } }
css:
lint:
rules:
keyframe-selector-notation: warn # off (default), warn, error
less:
lint:
rules:
keyframe-selector-notation: warn # off (default), warn, error
scss:
lint:
rules:
keyframe-selector-notation: warn # off (default), warn, error

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line keyframe-selector-notation 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-selector-notation full