mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 03:16:11 +01:00
Fixes for SCSS compiler
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
namespace Grav\Plugin\Admin;
|
||||
|
||||
use ScssPhp\ScssPhp\Compiler;
|
||||
use ScssPhp\ScssPhp\ValueConverter;
|
||||
|
||||
class ScssCompiler
|
||||
{
|
||||
@@ -31,7 +32,13 @@ class ScssCompiler
|
||||
|
||||
public function setVariables(array $variables)
|
||||
{
|
||||
$this->compiler()->setVariables($variables);
|
||||
// $parsed = ValueConverter::fromPhp($variables);
|
||||
$parsed = [];
|
||||
foreach ($variables as $key => $value) {
|
||||
$parsed[$key] = ValueConverter::parseValue($value);
|
||||
}
|
||||
|
||||
$this->compiler()->addVariables($parsed);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -55,7 +62,7 @@ class ScssCompiler
|
||||
foreach ($input_paths as $input_file) {
|
||||
$input .= trim(file_get_contents($input_file)) . "\n\n";
|
||||
}
|
||||
$output = $this->compiler()->compile($input);
|
||||
$output = $this->compiler()->compileString($input)->getCss();
|
||||
file_put_contents($output_file, $output);
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user