mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
add unit function. Fixes #307
This commit is contained in:
@@ -209,6 +209,9 @@ tree.functions = {
|
||||
str = str.replace(/%%/g, '%');
|
||||
return new(tree.Quoted)('"' + str + '"', str);
|
||||
},
|
||||
unit: function (val, unit) {
|
||||
return new(tree.Dimension)(val.value, unit ? unit.toCSS() : "");
|
||||
},
|
||||
round: function (n, f) {
|
||||
var fraction = typeof(f) === "undefined" ? 0 : f.value;
|
||||
if (n instanceof tree.Dimension) {
|
||||
|
||||
Reference in New Issue
Block a user