Automatically compile your SCSS (sassy CSS from SASS) to plain CSS whenever they actually change
Once installed (see Install), you can serve your SCSS source like this:
<?php
require_once 'vendor/autoload.php';
$scss = '$color: #fff;
body{
background: darken($color,10%);
color: invert($color);
}';
$cache = new scss_cache($scss);
$cache->serve();
If instead you want to serve your resulting CSS from SCSS files, use:
$cache = scss_cache::file('source.scss');
$cache->serve();
Or if you want to get your resulting CSS for further processing:
$scss = '...';
$cache = new scss_cache($scss);
$css = $cache->getOutput();
The recommended way to install this library is through composer. New to composer?
{
"require": {
"clue/scss-cache": "dev-master"
}
}