diff --git a/lib/less/functions/types.js b/lib/less/functions/types.js index 7502acf8..f6bfae92 100644 --- a/lib/less/functions/types.js +++ b/lib/less/functions/types.js @@ -57,24 +57,6 @@ functionRegistry.addMultiple({ isem: function (n) { return isunit(n, 'em'); }, - isrem: function (n) { - return isunit(n, 'rem'); - }, - isvw: function (n) { - return isunit(n, 'vw'); - }, - isvh: function (n) { - return isunit(n, 'vh'); - }, - isvmin: function (n) { - return isunit(n, 'vmin'); - }, - isvmax: function (n) { - return isunit(n, 'vmax'); - }, - isch: function (n) { - return isunit(n, 'ch'); - }, isunit: isunit, unit: function (val, unit) { if (!(val instanceof Dimension)) { diff --git a/lib/less/tree/unit.js b/lib/less/tree/unit.js index 2aa0e8b8..755cf8a5 100644 --- a/lib/less/tree/unit.js +++ b/lib/less/tree/unit.js @@ -42,7 +42,7 @@ Unit.prototype.is = function (unitString) { return this.toString().toUpperCase() === unitString.toUpperCase(); }; Unit.prototype.isLength = function () { - return RegExp('^(px|em|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'g').test(this.toCSS()); + return RegExp('^(px|em|rem|in|cm|mm|pc|pt|ex|vw|vh|vmin|vmax)$', 'gi').test(this.toCSS()); }; Unit.prototype.isEmpty = function () { return this.numerator.length === 0 && this.denominator.length === 0; diff --git a/test/less/functions.less b/test/less/functions.less index 431c2651..a95310a6 100644 --- a/test/less/functions.less +++ b/test/less/functions.less @@ -163,12 +163,12 @@ pixel: ispixel(32px); percent: ispercentage(32%); em: isem(32em); - rem: isrem(32rem); - vw: isvw(32vw); - vh: isvh(32vh); - vmin: isvmin(32vmin); - vmax: isvmax(32vmax); - ch: isch(32ch); + rem: isunit(32rem, rem); + vw: isunit(32vw, vw); + vh: isunit(32vh, vh); + vmin: isunit(32vmin, vmin); + vmax: isunit(32vmax, vmax); + ch: isunit(32ch, ch); cat: isunit(32cat, cat); no-unit-is-empty: isunit(32, ''); case-insensitive-1: isunit(32CAT, cat);