From e69433b8d173843c47640ce4bdb3300bf52aec83 Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Sat, 7 Jan 2012 01:33:54 +0100 Subject: [PATCH] rename is-* functions to is* --- lib/less/functions.js | 16 ++++++++-------- test/less/functions.less | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/less/functions.js b/lib/less/functions.js index b83361c3..6eb34bac 100644 --- a/lib/less/functions.js +++ b/lib/less/functions.js @@ -175,28 +175,28 @@ tree.functions = { throw { type: "Argument", message: "argument must be a string" }; } }, - 'is-color': function (n) { + iscolor: function (n) { return this._isa(n, tree.Color); }, - 'is-number': function (n) { + isnumber: function (n) { return this._isa(n, tree.Dimension); }, - 'is-string': function (n) { + isstring: function (n) { return this._isa(n, tree.Quoted); }, - 'is-keyword': function (n) { + iskeyword: function (n) { return this._isa(n, tree.Keyword); }, - 'is-url': function (n) { + isurl: function (n) { return this._isa(n, tree.URL); }, - 'is-pixel': function (n) { + ispixel: function (n) { return (n instanceof tree.Dimension) && n.unit === 'px' ? tree.True : tree.False; }, - 'is-percentage': function (n) { + ispercentage: function (n) { return (n instanceof tree.Dimension) && n.unit === '%' ? tree.True : tree.False; }, - 'is-em': function (n) { + isem: function (n) { return (n instanceof tree.Dimension) && n.unit === 'em' ? tree.True : tree.False; }, _isa: function (n, Type) { diff --git a/test/less/functions.less b/test/less/functions.less index dcbec22f..535d2efd 100644 --- a/test/less/functions.less +++ b/test/less/functions.less @@ -32,15 +32,15 @@ color: color("#ff0011"); .is-a { - color: is-color(#ddd); - color: is-color(red); - color: is-color(rgb(0, 0, 0)); - keyword: is-keyword(hello); - number: is-number(32); - string: is-string("hello"); - pixel: is-pixel(32px); - percent: is-percentage(32%); - em: is-em(32em); + color: iscolor(#ddd); + color: iscolor(red); + color: iscolor(rgb(0, 0, 0)); + keyword: iskeyword(hello); + number: isnumber(32); + string: isstring("hello"); + pixel: ispixel(32px); + percent: ispercentage(32%); + em: isem(32em); } }