🎉 initial commit
This commit is contained in:
31
classes/Application/ScssCompiler.php
Normal file
31
classes/Application/ScssCompiler.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Application;
|
||||
|
||||
use Application\Controller\MainController;
|
||||
use ScssPhp\ScssPhp\Compiler;
|
||||
use ScssPhp\ScssPhp\Exception\SassException;
|
||||
use ScssPhp\ScssPhp\OutputStyle;
|
||||
use ScssPhp\Server\Server;
|
||||
use ScssPhp\Server\ServerException;
|
||||
|
||||
class ScssCompiler
|
||||
{
|
||||
|
||||
/**
|
||||
* @throws ServerException
|
||||
* @throws SassException
|
||||
*/
|
||||
public function compile(): void
|
||||
{
|
||||
$scss = new Compiler();
|
||||
$scss->setImportPaths(MainController::DIR_TEMPLATES);
|
||||
$scss->setOutputStyle(OutputStyle::EXPANDED);
|
||||
$scss->setSourceMap(Compiler::SOURCE_MAP_INLINE);
|
||||
|
||||
$_GET['p'] = 'main.scss';
|
||||
|
||||
$server = new Server(MainController::DIR_TEMPLATES, MainController::DIR_CACHE . '/scss', $scss);
|
||||
$server->serve();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user