Skip to content

Commit

Permalink
Add testing for nested declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
niksy committed Sep 29, 2021
1 parent 2e3b972 commit 90e65fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -36,7 +36,7 @@
"npmpub": "^5.0.0",
"postcss": "^8.3.8",
"postcss-less": "^5.0.0",
"postcss-scss": "^4.0.0",
"postcss-scss": "^4.0.1",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
"stylelint": "github:stylelint/stylelint#v14"
Expand Down
4 changes: 2 additions & 2 deletions src/rules/declaration-nested-properties/index.js
Expand Up @@ -71,10 +71,10 @@ export default function(expectation, options) {
}

// Nested props, `prop: [value] { <nested decls> }`
if (type === "rule") {
if (type === "rule" || (type === "decl" && decl.isNested)) {
// `background:red {` - selector;
// `background: red {` - nested prop; space is decisive here
const testForProp = parseNestedPropRoot(selector);
const testForProp = parseNestedPropRoot(selector || decl.toString());

if (testForProp && testForProp.propName !== undefined) {
const ns = testForProp.propName.value;
Expand Down

0 comments on commit 90e65fe

Please sign in to comment.