From: Jakub Pawlowicz Date: Sun, 29 Jun 2014 21:28:03 +0000 (+0100) Subject: Removes extra spaces around / in border-radius. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=568e3b081b02ca047db6371b31249711c3b22b86;p=clean-css.git Removes extra spaces around / in border-radius. * Apparently horizontal & vertical values can be separated by '/' without spaces around - thanks @XhmikosR. --- diff --git a/History.md b/History.md index 4ccd2770..b59842d4 100644 --- a/History.md +++ b/History.md @@ -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) diff --git a/lib/clean.js b/lib/clean.js index 4abf14bd..a4145068 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -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); }); diff --git a/lib/properties/processable.js b/lib/properties/processable.js index 29a6077d..f1f3fc1e 100644 --- a/lib/properties/processable.js +++ b/lib/properties/processable.js @@ -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; diff --git a/test/unit-test.js b/test/unit-test.js index b3a2802c..31cdbe51 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -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}'