diff --git a/src/rules/selector-nest-combinators/__tests__/index.js b/src/rules/selector-nest-combinators/__tests__/index.js index bfd948cf..f86fb707 100644 --- a/src/rules/selector-nest-combinators/__tests__/index.js +++ b/src/rules/selector-nest-combinators/__tests__/index.js @@ -107,6 +107,19 @@ testRule(rule, { } `, description: "ignores nested properties" + }, + { + code: ` + @keyframes foo { + 0% { + color: blue; + } + 50.5% { + color: red; + } + } + `, + description: "ignores @keyframes" } ], @@ -262,6 +275,19 @@ testRule(rule, { } `, description: "ignores nested properties" + }, + { + code: ` + @keyframes foo { + 0% { + color: blue; + } + 50.5% { + color: red; + } + } + `, + description: "ignores @keyframes" } ], diff --git a/src/rules/selector-nest-combinators/index.js b/src/rules/selector-nest-combinators/index.js index ffe7ff13..63f2a36f 100644 --- a/src/rules/selector-nest-combinators/index.js +++ b/src/rules/selector-nest-combinators/index.js @@ -46,6 +46,14 @@ export default function(expectation) { const interpolationRe = /#{.+?}$/; root.walkRules(rule => { + if ( + rule.parent && + rule.parent.type === "atrule" && + rule.parent.name === "keyframes" + ) { + return; + } + if (typeof rule.selector === "string") { const isNestedProperty = rule.selector.slice(-1) === ":";