scss autoloader + jsonresponse fixes

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-12-29 08:07:59 -08:00
parent 24da355b47
commit 3b5caaf4e8
3 changed files with 71 additions and 15 deletions

View File

@@ -23,7 +23,20 @@ class WhiteLabel
public function __construct()
{
$this->grav = Grav::instance();
$this->scss = new ScssCompiler();
// ScssCompiler is now lazy-loaded to avoid loading scssphp classes until actually needed
}
/**
* Get the ScssCompiler instance (lazy-loaded)
*
* @return ScssCompiler
*/
protected function getScss(): ScssCompiler
{
if ($this->scss === null) {
$this->scss = new ScssCompiler();
}
return $this->scss;
}
public function compilePresetScss($config, $options = [
@@ -61,7 +74,7 @@ class WhiteLabel
}
try {
$compiler = $this->scss->reset();
$compiler = $this->getScss()->reset();
$compiler->setVariables($color_scheme['colors'] + $color_scheme['accents']);
$compiler->setImportPaths($imports);