carto/lib/less/tree/value.js

25 lines
575 B
JavaScript
Raw Normal View History

2010-06-16 06:46:09 +08:00
(function (tree) {
2010-06-19 13:51:26 +08:00
tree.Value = function (value) {
2010-06-16 06:46:09 +08:00
this.value = value;
this.is = 'value';
};
tree.Value.prototype = {
eval: function (env) {
if (this.value.length === 1) {
return this.value[0].eval(env);
} else {
return new(tree.Value)(this.value.map(function (v) {
return v.eval(env);
}));
}
},
toCSS: function (env) {
return this.value.map(function (e) {
return e.toCSS(env);
}).join(env.compress ? ',' : ', ');
}
};
})(require('less/tree'));