mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-03-04 19:41:31 +01:00
fixes for scss and autoloading
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user