diff --git a/lib/helpers.js b/lib/helpers.js index 68e45fd4..5fe25c42 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -182,10 +182,7 @@ helpers.isHyphenatedBEM = function (str) { }; helpers.isValidHex = function (str) { - if (str.match(/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/)) { - return true; - } - return false; + return /^([a-f0-9]{8}|[a-f0-9]{6}|[a-f0-9]{4}|[a-f0-9]{3})$/i.test(str); }; /**