keyframe-block-no-duplicate-selectors
CSS / SCSS / LessCSS / SCSS / LessCSS / SCSS / Lesssuspiciousno fixdefault: warncss/stylelint-recommended
What it does
Section titled “What it does”Reports a selector that is used twice in one @keyframes rule (from and FROM count as the same, names are compared in lowercase).
Why it matters
Section titled “Why it matters”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.
Example
Section titled “Example”...@media print { a { color: red } }@keyframes k { from { top: 0 } FROM { top: 1px } 0% { top: 2px } }Configuration
Section titled “Configuration”css: lint: rules: keyframe-block-no-duplicate-selectors: warn # off, warn (default), errorless: lint: rules: keyframe-block-no-duplicate-selectors: warn # off, warn (default), errorscss: lint: rules: keyframe-block-no-duplicate-selectors: warn # off, warn (default), errorEnabled 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.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| stylelint | keyframe-block-no-duplicate-selectors |
full |