Files
less.js/lib/less/tree/keyword.js
Alexis Sellier 5ec708c3f4 type-checking stylesheet functions
is-string, is-keyword, is-color, is-number
2012-01-03 18:45:31 +01:00

20 lines
485 B
JavaScript

(function (tree) {
tree.Keyword = function (value) { this.value = value };
tree.Keyword.prototype = {
eval: function () { return this },
toCSS: function () { return this.value },
compare: function (other) {
if (other instanceof tree.Keyword) {
return other.value === this.value ? 0 : 1;
} else {
return -1;
}
}
};
tree.True = new(tree.Keyword)('true');
tree.False = new(tree.Keyword)('false');
})(require('../tree'));