fixes for scss and autoloading

Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
Andy Miller
2025-12-29 02:59:32 -07:00
parent 6c0349ac4c
commit c5cb89338e
3 changed files with 73 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);