]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Correct the regex pattern feature/color-regex-pattern 10589/head
authorHarry Manchanda <harmanmanchanda182@gmail.com>
Mon, 28 Aug 2017 13:20:00 +0000 (18:50 +0530)
committerGitHub <noreply@github.com>
Mon, 28 Aug 2017 13:20:00 +0000 (18:50 +0530)
Add support for `f00`, `ff0000` and remove support for `#ff00ff00` and `#ff00`

js/foundation.abide.js

index 3f793078b85f13c1c5aa521f7b36324a8d4b39d7..83e0c69df22d73db1680903da173948b0e05716a 100644 (file)
@@ -559,7 +559,7 @@ Abide.defaults = {
     day_month_year : /^(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.]\d{4}$/,
 
     // Hex (#FFF or #FFFFFF) || RGB || RGBA || HSL || HSLA
-    color : /^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,
+    color : /^(#?([0-9a-f]{3}|[0-9a-f]{6})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))$/i,
 
     // Domain || URL
     website: {