Open GoogleCodeExporter opened 9 years ago
I hope this may help you:
require_once APP_ROOT.'/vendor/PHamlP/sass/SassParser.php';
$sass = new SassParser(array( 'cache' => true,
'cache_location' => APP_ROOT.'/tmp/scss',
'css_location' => APP_ROOT.'/public/css',
'template_location' => APP_ROOT.'/app/scss',
'syntax' => 'scss',
));
function scss_to_file($filename) {
global $sass;
$css = $sass->toCss($filename);
$sourceFile = $sass->getFilename();
$outputCssFile = pathinfo($filename, PATHINFO_FILENAME).'.css';
$outputFile = $sass->getCss_location().'/'.$outputCssFile;
if (!is_file($outputFile) || @filemtime($sourceFile) > @filemtime($outputFile)) {
if (file_put_contents($outputFile, $css) === false)
return false;
@chmod($outputFile, 0644);
}
return $outputCssFile;
}
<link href="/css/<?= scss_to_file('style.scss') ?>" rel="stylesheet"
media="screen">
Original comment by vadym.lu...@gmail.com
on 16 Mar 2013 at 5:09
Original issue reported on code.google.com by
p...@8-bitdesign.com
on 10 Jan 2012 at 6:40