Skip to content

Commit 8019439

Browse files
dmcasslukeapage
authored andcommitted
Pass env with toCSS in function call evaluation; Add tests; Fixes less#957
1 parent 819d6b0 commit 8019439

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

lib/less/tree/call.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ tree.Call.prototype = {
3636
}
3737
} else { // 2.
3838
return new(tree.Anonymous)(this.name +
39-
"(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
39+
"(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")");
4040
}
4141
},
4242

test/css/functions.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
height: undefined("self");
55
border-width: 5;
66
variable: 11;
7+
background: linear-gradient(#000000, #ffffff);
78
}
89
#built-in {
910
escaped: -Some::weird(#thing, y);

test/less/functions.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#functions {
22
@var: 10;
3+
@colors: #000, #fff;
34
color: _color("evil red"); // #660000
45
width: increment(15);
56
height: undefined("self");
67
border-width: add(2, 3);
78
variable: increment(@var);
9+
background: linear-gradient(@colors);
810
}
911

1012
#built-in {

0 commit comments

Comments
 (0)