diff --git a/src/rules/declaration-nested-properties/__tests__/index.js b/src/rules/declaration-nested-properties/__tests__/index.js index f75148e5..cdae7a08 100644 --- a/src/rules/declaration-nested-properties/__tests__/index.js +++ b/src/rules/declaration-nested-properties/__tests__/index.js @@ -33,6 +33,17 @@ testRule(rule, { } `, description: "{ always } Vendor prefixed rules." + }, + { + code: ` + a { + font: { + size: 10px; + weight: 400; + } + } + `, + description: "nested properties" } ] }); diff --git a/src/rules/selector-nest-combinators/__tests__/index.js b/src/rules/selector-nest-combinators/__tests__/index.js index b92bd03b..bfd948cf 100644 --- a/src/rules/selector-nest-combinators/__tests__/index.js +++ b/src/rules/selector-nest-combinators/__tests__/index.js @@ -96,6 +96,17 @@ testRule(rule, { } `, description: "should support interpolation" + }, + { + code: ` + a { + font: { + size: 10px; + weight: 400; + } + } + `, + description: "ignores nested properties" } ], @@ -240,6 +251,17 @@ testRule(rule, { .class-name #{if(&, "&", "")} {} `, description: "should support interpolation" + }, + { + code: ` + a { + font: { + size: 10px; + weight: 400; + } + } + `, + description: "ignores nested properties" } ], diff --git a/src/rules/selector-nest-combinators/index.js b/src/rules/selector-nest-combinators/index.js index c3ac73d1..ffe7ff13 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 (typeof rule.selector === "string") { + const isNestedProperty = rule.selector.slice(-1) === ":"; + + if (isNestedProperty) { + return; + } + } + parseSelector(rule.selector, result, rule, fullSelector => { let message;