From 99081608beb2487bd6034d089fe74ebff0d68380 Mon Sep 17 00:00:00 2001 From: Krister Kari Date: Mon, 28 Dec 2015 22:04:24 +0200 Subject: [PATCH] Format declarations for atrules --- lib/formatAtRules.js | 1 + test/fixtures/nested-mixin.css | 12 ++++++++++++ test/fixtures/nested-mixin.out.css | 15 +++++++++++++++ test/index.js | 1 + 4 files changed, 29 insertions(+) create mode 100644 test/fixtures/nested-mixin.css create mode 100644 test/fixtures/nested-mixin.out.css diff --git a/lib/formatAtRules.js b/lib/formatAtRules.js index ceb43f7..eb550b2 100644 --- a/lib/formatAtRules.js +++ b/lib/formatAtRules.js @@ -24,6 +24,7 @@ function formatAtRules (root) { } else { atruleBefore = '\n\n' + getIndent(atrule) } + formatDecls(atrule) } if (parentType === 'rule') { if (atrule.parent.first === atrule) { diff --git a/test/fixtures/nested-mixin.css b/test/fixtures/nested-mixin.css new file mode 100644 index 0000000..400a7a9 --- /dev/null +++ b/test/fixtures/nested-mixin.css @@ -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; + } +} diff --git a/test/fixtures/nested-mixin.out.css b/test/fixtures/nested-mixin.out.css new file mode 100644 index 0000000..3e7c754 --- /dev/null +++ b/test/fixtures/nested-mixin.out.css @@ -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; + } +} diff --git a/test/index.js b/test/index.js index c9d40e6..df56aa6 100644 --- a/test/index.js +++ b/test/index.js @@ -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')