mirror of
https://github.com/less/less.js.git
synced 2026-01-24 06:38:05 -05:00
30 lines
636 B
JavaScript
30 lines
636 B
JavaScript
module.exports = function (tree) {
|
|
|
|
var Alpha = function (val) {
|
|
this.value = val;
|
|
};
|
|
Alpha.prototype = {
|
|
type: "Alpha",
|
|
accept: function (visitor) {
|
|
this.value = visitor.visit(this.value);
|
|
},
|
|
eval: function (env) {
|
|
if (this.value.eval) { return new Alpha(this.value.eval(env)); }
|
|
return this;
|
|
},
|
|
genCSS: function (env, output) {
|
|
output.add("alpha(opacity=");
|
|
|
|
if (this.value.genCSS) {
|
|
this.value.genCSS(env, output);
|
|
} else {
|
|
output.add(this.value);
|
|
}
|
|
|
|
output.add(")");
|
|
},
|
|
toCSS: tree.toCSS
|
|
};
|
|
return Alpha;
|
|
};
|