Skip to content

Commit

Permalink
Merge pull request #49 from kristerkari/bugfix/format-atrule-decls
Browse files Browse the repository at this point in the history
Format declarations for atrules
  • Loading branch information
Masaaki Morishita committed Dec 28, 2015
2 parents 0b2fc69 + 9908160 commit 238c6c2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/formatAtRules.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ function formatAtRules (root) {
} else {
atruleBefore = '\n\n' + getIndent(atrule)
}
formatDecls(atrule)
}
if (parentType === 'rule') {
if (atrule.parent.first === atrule) {
Expand Down
12 changes: 12 additions & 0 deletions test/fixtures/nested-mixin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@mixin test() {
$values: blue red;
@each $val in $values {
color: $val;
@for $i from 2 through 10 {
background: $i;
}
}
@for $i from 2 through 10 {
color: $i;
}
}
15 changes: 15 additions & 0 deletions test/fixtures/nested-mixin.out.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@mixin test() {
$values: blue red;

@each $val in $values {
color: $val;

@for $i from 2 through 10 {
background: $i;
}
}

@for $i from 2 through 10 {
color: $i;
}
}
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ test('comment')
test('comment-in-rules')
test('vendor-prefix')
test('nested-atrule')
test('nested-mixin')
test('font-face')
test('import')
test('charset')
Expand Down

0 comments on commit 238c6c2

Please sign in to comment.