Shortens `border-radius` addFourValueShorthand calls.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 29 Jun 2014 20:57:12 +0000 (21:57 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 29 Jun 2014 22:28:03 +0000 (23:28 +0100)
lib/properties/processable.js

index 301138f..29a6077 100644 (file)
@@ -718,44 +718,16 @@ module.exports = (function () {
     }
   };
 
-  addFourValueShorthand('border-radius', [
-    'border-top-left-radius',
-    'border-top-right-radius',
-    'border-bottom-right-radius',
-    'border-bottom-left-radius'
-  ], {
-    breakUp: breakUp.borderRadius,
-    putTogether: putTogether.borderRadius
-  });
-
-  addFourValueShorthand('-moz-border-radius', [
-    '-moz-border-top-left-radius',
-    '-moz-border-top-right-radius',
-    '-moz-border-bottom-right-radius',
-    '-moz-border-bottom-left-radius'
-  ], {
-    breakUp: breakUp.borderRadius,
-    putTogether: putTogether.borderRadius
-  });
-
-  addFourValueShorthand('-webkit-border-radius', [
-    '-webkit-border-top-left-radius',
-    '-webkit-border-top-right-radius',
-    '-webkit-border-bottom-right-radius',
-    '-webkit-border-bottom-left-radius'
-  ], {
-    breakUp: breakUp.borderRadius,
-    putTogether: putTogether.borderRadius
-  });
-
-  addFourValueShorthand('-o-border-radius', [
-    '-o-border-top-left-radius',
-    '-o-border-top-right-radius',
-    '-o-border-bottom-right-radius',
-    '-o-border-bottom-left-radius'
-  ], {
-    breakUp: breakUp.borderRadius,
-    putTogether: putTogether.borderRadius
+  ['', '-moz-', '-o-', '-webkit-'].forEach(function (prefix) {
+    addFourValueShorthand(prefix + 'border-radius', [
+      prefix + 'border-top-left-radius',
+      prefix + 'border-top-right-radius',
+      prefix + 'border-bottom-right-radius',
+      prefix + 'border-bottom-left-radius'
+    ], {
+      breakUp: breakUp.borderRadius,
+      putTogether: putTogether.borderRadius
+    });
   });
 
   addFourValueShorthand('border-color', [