Annilhilated the festival

This commit is contained in:
Jacob Ward
2018-04-30 15:07:15 +01:00
parent cb7f5634ec
commit d0e53dd395
3 changed files with 7 additions and 25 deletions

View File

@@ -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)) {

View File

@@ -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;

View File

@@ -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);