Skip to content

Commit

Permalink
Merge pull request #52 from Riim/patch-1
Browse files Browse the repository at this point in the history
fix order of rules
  • Loading branch information
ai authored May 8, 2017
2 parents 7f995da + 601da4b commit 7f67183
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ function processRule(rule, bubble) {
child.selectors = selectors(rule, child);
after = pickComment(child.prev(), after);
after.after(child);
after = child;
} else if ( child.type === 'atrule' ) {
if ( bubble.indexOf(child.name) !== -1 ) {
unwrapped = true;
atruleChilds(rule, child);
after = pickComment(child.prev(), after);
after.after(child);
after = child;
}
}
});
Expand Down
5 changes: 5 additions & 0 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,8 @@ it('parses example', () => {
'}';
run(input, output);
});

it('saves order of rules', () => {
run('.one { & .two {} & .tree {} }',
'.one .two {} .one .tree {}');
});

0 comments on commit 7f67183

Please sign in to comment.