diff --git a/lib/less/to-css-visitor.js b/lib/less/to-css-visitor.js index 5668aca1b..af4ac5432 100644 --- a/lib/less/to-css-visitor.js +++ b/lib/less/to-css-visitor.js @@ -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); } } diff --git a/test/css/merge.css b/test/css/merge.css index 4cf8c579e..18539f1a8 100644 --- a/test/css/merge.css +++ b/test/css/merge.css @@ -20,3 +20,7 @@ .test6 { transform: scale(2, 4); } +.test-interleaved { + transform: t1, t2, t3; + background: b1, b2, b3; +} diff --git a/test/less/merge.less b/test/less/merge.less index 52d0796e3..f7070d631 100644 --- a/test/less/merge.less +++ b/test/less/merge.less @@ -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(); } @@ -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; } \ No newline at end of file