2021-01-15 16:32:06 +01:00
|
|
|
<?php
|
|
|
|
/* Icinga Web 2 | (c) 2021 Icinga GmbH | GPLv2+ */
|
|
|
|
|
|
|
|
namespace Icinga\Util;
|
|
|
|
|
2021-12-01 14:24:57 +01:00
|
|
|
use Icinga\Less\Visitor;
|
2021-01-15 16:32:06 +01:00
|
|
|
use lessc;
|
|
|
|
|
|
|
|
require_once 'lessphp/lessc.inc.php';
|
|
|
|
|
|
|
|
class LessParser extends lessc
|
|
|
|
{
|
2022-02-09 21:32:50 +01:00
|
|
|
/**
|
|
|
|
* @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject
|
|
|
|
* light mode calls
|
|
|
|
*/
|
|
|
|
public function __construct($disableModes = false)
|
2021-06-23 10:59:47 +02:00
|
|
|
{
|
2022-02-09 21:32:50 +01:00
|
|
|
if (! $disableModes) {
|
|
|
|
$this->setOption('plugins', [new Visitor()]);
|
|
|
|
}
|
2021-06-23 10:59:47 +02:00
|
|
|
}
|
2021-01-15 16:32:06 +01:00
|
|
|
}
|