Skip to content

Commit

Permalink
Merge pull request #1743 from seven-phases-max/property-merge-fix
Browse files Browse the repository at this point in the history
Interleaved property merge fix
  • Loading branch information
lukeapage committed Dec 20, 2013
2 parents 7e43575 + 361fd89 commit c064091
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/less/to-css-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@
rule.important ? "!" : ""].join(",");

if (!groups[key]) {
parts = groups[key] = [];
groups[key] = [];
} else {
rules.splice(i--, 1);
}

parts.push(rule);
groups[key].push(rule);
}
}

Expand Down
4 changes: 4 additions & 0 deletions test/css/merge.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
.test6 {
transform: scale(2, 4);
}
.test-interleaved {
transform: t1, t2, t3;
background: b1, b2, b3;
}
10 changes: 9 additions & 1 deletion test/less/merge.less
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
.first-background();
}
.test4 {
// Wont merge values from sources that merked as !important, for backwards compatibility with css
// Wont merge values from sources that merked as !important, for backwards compatibility with css
.first-transform();
.fifth-transform();
}
Expand All @@ -48,4 +48,12 @@
.test6 {
// Ignores !merge if no peers found
.second-transform();
}

.test-interleaved {
transform+: t1;
background+: b1;
transform+: t2;
background+: b2, b3;
transform+: t3;
}

0 comments on commit c064091

Please sign in to comment.