diff --git a/composer.json b/composer.json index 7536b73..c67126f 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "description": "Parse/Compress Less to CSS", "keywords": ["less", "css", "php", "stylesheet", "less.js", "lesscss"], "homepage": "https://github.com/joffreydemetz/less2css/", - "version": "2.0.3", + "version": "2.0.4", "license": "MIT", "authors": [ diff --git a/src/Minifier/SimpleMinifier.php b/src/Minifier/SimpleMinifier.php index 4ba51d4..17d5be9 100644 --- a/src/Minifier/SimpleMinifier.php +++ b/src/Minifier/SimpleMinifier.php @@ -25,7 +25,8 @@ public function compressCss() // Add space after :not(...) $css = preg_replace("/:not\(([^\)]+)\)([^\s:])/", ":not($1) $2", $css); - + $css = preg_replace("/:nth-(child|of-type)\(([^\)]+)\)([^\s:])/", ":nth-$1($2) $3", $css); + $css = preg_replace("/\)\s*and\s*\(/", ") and (", $css); $css = str_replace('--EURO--', '€', $css); return $css; @@ -86,7 +87,7 @@ protected function cleanFirstPass($str) protected function cleanSecondPass($str) { // Normalize whitespace - $str = preg_replace("/\s+/", " ", $str); + $str = preg_replace("/\s\s+/", " ", $str); // Remove ; before } $str = preg_replace("/;(?=\s*})/", "$1", $str);