first commit
This commit is contained in:
28
class/sacy/phpsass.php
Normal file
28
class/sacy/phpsass.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace sacy;
|
||||
|
||||
class PhpSassSacy
|
||||
{
|
||||
public static function isAvailable()
|
||||
{
|
||||
return extension_loaded('sass')/* && defined('SASS_FLAVOR') && SASS_FLAVOR == 'sensational' */
|
||||
;
|
||||
}
|
||||
|
||||
public static function compile($file, $fragment, $load_path)
|
||||
{
|
||||
$sass = new \Sass();
|
||||
|
||||
$load_path = array_map(function ($x) {
|
||||
return getcwd().$x;
|
||||
}, $load_path);
|
||||
$sass->setIncludePath(implode(':', $load_path));
|
||||
|
||||
if ($file) {
|
||||
return $sass->compile_file($file);
|
||||
} else {
|
||||
return $sass->compile($fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user