Skip to content

Commit

Permalink
Format declarations for atrules
Browse files Browse the repository at this point in the history
  • Loading branch information
Krister Kari committed Dec 28, 2015
1 parent 0a6fdef commit 9908160
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('pseudo-element')
Expand Down

0 comments on commit 9908160

Please sign in to comment.