Removes extra spaces around / in border-radius.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 29 Jun 2014 21:28:03 +0000 (22:28 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Sun, 29 Jun 2014 22:28:04 +0000 (23:28 +0100)
* Apparently horizontal & vertical values can be separated by '/' without spaces around - thanks @XhmikosR.

History.md
lib/clean.js
lib/properties/processable.js
test/unit-test.js

index 4ccd277..b59842d 100644 (file)
@@ -1,6 +1,7 @@
 [2.2.5 / 2014-xx-xx](https://github.com/GoalSmashers/clean-css/compare/v2.2.4...v2.2.5)
 ==================
 
+* Adds removing extra spaces around / in border-radius.
 * Fixed issue [#305](https://github.com/GoalSmashers/clean-css/issues/305) - allows width keywords in border-width.
 
 [2.2.4 / 2014-06-27](https://github.com/GoalSmashers/clean-css/compare/v2.2.3...v2.2.4)
index 4abf14b..a414506 100644 (file)
@@ -346,6 +346,9 @@ var minify = function(data, callback) {
     });
   }
 
+  // replace ' / ' in border-*-radius with '/'
+  replace(/(border-\w+-\w+-radius:\S+)\s+\/\s+/g, '$1/');
+
   replace(function restoreUrls() {
     data = urlsProcessor.restore(data);
   });
index 29a6077..f1f3fc1 100644 (file)
@@ -529,7 +529,7 @@ module.exports = (function () {
       var result = putTogether.takeCareOfInherit(putTogether.fourUnits)(prop, tokens, isImportant);
       if (verticalTokens.length > 0) {
         var verticalResult = putTogether.takeCareOfInherit(putTogether.fourUnits)(prop, verticalTokens, isImportant);
-        result.value += ' / ' + verticalResult.value;
+        result.value += '/' + verticalResult.value;
       }
 
       return result;
index b3a2802..31cdbe5 100644 (file)
@@ -1952,17 +1952,20 @@ title']{display:block}",
       'a{outline:5px auto -webkit-focus-ring-color}',
       'a{outline:-webkit-focus-ring-color auto 5px}'
     ],
-    'border radius side H+V': 'a{border-top-left-radius:1em / 1em}',
+    'border radius side H+V': [
+      'a{border-top-left-radius:1em / 1em}',
+      'a{border-top-left-radius:1em/1em}'
+    ],
     'border radius expanded H+V': [
       'a{border-radius:1em 1em 1em 1em / 2em 2em 2em 2em}',
-      'a{border-radius:1em / 2em}'
+      'a{border-radius:1em/2em}'
     ],
     'border radius expanded H+V with mixed values #1': [
       'a{border-radius:1em 2em 1em 2em / 1em 2em 3em 2em}',
-      'a{border-radius:1em 2em / 1em 2em 3em}'
+      'a{border-radius:1em 2em/1em 2em 3em}'
     ],
-    'border radius expanded H+V with mixed values #2': 'a{border-radius:1em / 1em 1em 1em 2em}',
-    'border radius H+V': 'a{border-radius:50% / 100%}'
+    'border radius expanded H+V with mixed values #2': 'a{border-radius:1em/1em 1em 1em 2em}',
+    'border radius H+V': 'a{border-radius:50%/100%}'
   }),
   'viewport units': cssContext({
     'shorthand margin with viewport width not changed': 'div{margin:5vw}'