Skip to content

Commit

Permalink
LessRuleset: Use wikimedia/less.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Aug 28, 2023
1 parent 236fe67 commit 11a6849
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"ipl/orm": ">=0.5.2",
"ipl/scheduler": ">=0.1.0",
"ipl/stdlib": ">=0.12.0",
"fortawesome/font-awesome": "^6"
"fortawesome/font-awesome": "^6",
"wikimedia/less.php": "^3.2.1"
},
"require-dev": {
"ipl/html": "dev-main",
Expand Down
8 changes: 4 additions & 4 deletions src/LessRuleset.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace ipl\Web;

use ArrayObject;
use Icinga\Util\LessParser;
use Less_Parser;

/**
* @extends ArrayObject<string, string>
Expand Down Expand Up @@ -144,10 +144,10 @@ public function addRuleset(LessRuleset $ruleset): self
*/
public function renderCss(): string
{
$lessc = new LessParser();
$lessc->setFormatter('compressed');
$parser = new Less_Parser(['compress' => true]);
$parser->parse($this->renderLess());

return $lessc->compile($this->renderLess());
return $parser->getCss();
}

/**
Expand Down

0 comments on commit 11a6849

Please sign in to comment.