Skip to content

Commit

Permalink
2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
joffreydemetz committed Sep 18, 2019
1 parent dfa44f9 commit d5ec5de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
5 changes: 3 additions & 2 deletions src/Minifier/SimpleMinifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d5ec5de

Please sign in to comment.