mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
better JavaScript evaluation
- support for returning Array values - Expressions/Values are passed as arrays to JavaScript - fixed some edge cases
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
js: 42;
|
||||
js: 2;
|
||||
js: "hello world";
|
||||
js: 1, 2, 3;
|
||||
title: "node";
|
||||
ternary: true;
|
||||
}
|
||||
@@ -14,4 +15,8 @@
|
||||
}
|
||||
.escape-interpol {
|
||||
width: hello world;
|
||||
};
|
||||
}
|
||||
.arrays {
|
||||
ary: "1, 2, 3";
|
||||
ary: "1, 2, 3";
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
js: `42`;
|
||||
js: `1 + 1`;
|
||||
js: `"hello world"`;
|
||||
js: `[1, 2, 3]`;
|
||||
title: `process.title`;
|
||||
ternary: `(1 + 1 == 2 ? true : false)`;
|
||||
}
|
||||
.scope {
|
||||
@foo: 42;
|
||||
var: `this.foo.toJS()`;
|
||||
escaped: e(`2 + 5 + 'px'`);
|
||||
escaped: ~`2 + 5 + 'px'`;
|
||||
}
|
||||
.vars {
|
||||
@var: `4 + 4`;
|
||||
@@ -16,5 +17,11 @@
|
||||
}
|
||||
.escape-interpol {
|
||||
@world: "world";
|
||||
width: ~`"hello" + " " + "@{world}"`;
|
||||
width: ~`"hello" + " " + @{world}`;
|
||||
}
|
||||
.arrays {
|
||||
@ary: 1, 2, 3;
|
||||
@ary2: 1 2 3;
|
||||
ary: `@{ary}.join(', ')`;
|
||||
ary: `@{ary2}.join(', ')`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user