mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
refactors + support for onAdminCompilePresetSCSS() event
This commit is contained in:
@@ -21,19 +21,19 @@ class ScssCompiler
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setVariables($variables)
|
||||
public function setVariables(array $variables)
|
||||
{
|
||||
$this->compiler()->setVariables($variables);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setImportPaths($paths)
|
||||
public function setImportPaths(array $paths)
|
||||
{
|
||||
$this->compiler()->setImportPaths($paths);
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function compile($input_file, $output_file)
|
||||
public function compile(string $input_file, string $output_file)
|
||||
{
|
||||
$input = file_get_contents($input_file);
|
||||
$output = $this->compiler()->compile($input);
|
||||
@@ -41,4 +41,15 @@ class ScssCompiler
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function compileAll(array $input_paths, string $output_file)
|
||||
{
|
||||
$input = '';
|
||||
foreach ($input_paths as $input_file) {
|
||||
$input .= trim(file_get_contents($input_file)) . "\n\n";
|
||||
}
|
||||
$output = $this->compiler()->compile($input);
|
||||
file_put_contents($output_file, $output);
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user