Skip to content

keyframes-name-pattern

Reports a @keyframes name that does not match the pattern option (a regex). An empty pattern allows everything.

Animation names are global to the page, so a convention (a prefix, kebab case) keeps them predictable and lowers the risk of two animations having the same name. The rule is a policy: with no pattern it reports nothing.

Reported
...
@keyframes badFrames { from { top: 0 } }
@keyframes good-frames { from { top: 0 } }
...
@custom-media --good-media (min-width: 1px);
...
css:
lint:
rules:
keyframes-name-pattern:
level: warn # off (default), warn, error
options:
pattern: ""
less:
lint:
rules:
keyframes-name-pattern:
level: warn # off (default), warn, error
options:
pattern: ""
scss:
lint:
rules:
keyframes-name-pattern:
level: warn # off (default), warn, error
options:
pattern: ""
Option Type Default Description
pattern string "" The regex a keyframes name must match.

Enabled by the presets: css/stylelint-standard.

Suppress one line with sudsy-disable-next-line keyframes-name-pattern 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 keyframes-name-pattern full