Skip to content

Commit 04cb8bd

Browse files
committed
fix regression with jsifying code - all dimensions would be rounded. Fixes #2057
1 parent 4c094e7 commit 04cb8bd

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

lib/less/tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ tree.find = function (obj, fun) {
4343

4444
tree.jsify = function (obj) {
4545
if (Array.isArray(obj.value) && (obj.value.length > 1)) {
46-
return '[' + obj.value.map(function (v) { return v.toCSS(false); }).join(', ') + ']';
46+
return '[' + obj.value.map(function (v) { return v.toCSS(); }).join(', ') + ']';
4747
} else {
48-
return obj.toCSS(false);
48+
return obj.toCSS();
4949
}
5050
};
5151

test/css/javascript.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@
2121
ary: "1, 2, 3";
2222
ary1: "1, 2, 3";
2323
}
24+
.test-tran {
25+
1: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
26+
2: [opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear];
27+
3: opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;
28+
}

test/less/javascript.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@
2727
ary: `@{ary}.join(', ')`;
2828
ary1: `@{ary2}.join(', ')`;
2929
}
30+
.transitions(...) {
31+
@arg: ~`"@{arguments}".replace(/[\[\]]*/g, '')`;
32+
1: @arg; // rounded to integers
33+
2: ~`"@{arguments}"`; // rounded to integers
34+
3: @arguments; // OK
35+
}
36+
.test-tran {
37+
.transitions(opacity 0.3s ease-in 0.3s, max-height 0.6s linear, margin-bottom 0.4s linear;);
38+
}

0 commit comments

Comments
 (0)