Skip to content

Commit

Permalink
#378: Hack for braces in space-between-declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyganch committed May 20, 2015
1 parent 3204363 commit 3717cba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/options/space-between-declarations.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ module.exports = (function() {
var value = this.getValue('space-between-declarations');

// TODO: Limit nodes to blocks, stylesheet, etc.
// XXX: Hack for braces
if (node.is('braces')) return;

for (var i = 0, l = node.length; i < l; i++) {
if (!node.get(i) || !node.get(i).is('declarationDelimiter')) continue;
Expand Down
3 changes: 3 additions & 0 deletions test/options/space-between-declarations/issue-378.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@media (min-width: 768px) {
body { background: red; }
}
5 changes: 5 additions & 0 deletions test/options/space-between-declarations/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ describe('options/space-between-declarations:', function() {
this.comb.configure({ 'space-between-declarations': '\n ' });
this.shouldBeEqual('issue-239.css', 'issue-239.expected.css');
});

it('Issue 378', function() {
this.comb.configure({ 'space-between-declarations': '\n' });
this.shouldBeEqual('issue-378.css');
});
});

0 comments on commit 3717cba

Please sign in to comment.