library sass
Sass middleware for Rackem
rackem/sass
Sass middleware for Rackem
- Tuesday, April 8, 2014
- by tamagokun
- Repository
- 2 Watchers
- 0 Stars
- 55 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
Rack'em Sass
Rack'em middleware to serve SASS dynamically., (*1)
Usage
<?php
# config.php
// Rack up the middleware and you are good to go!
\Rackem::use_middleware(new \Rackem\Sass());
// or map to a specific path
\Rackem::map("/css", function($env) {
$sass = new \Rackem\Sass\Environment();
$sass->append_path("src/sass");
return $sass->call($env);
});
Options
You can pass an options array() with the middleware, or to a Rackem\Sass\Enviroment instance., (*2)
| Option |
Info |
Default |
| accepts |
File extensions used to locate sass source files (order matters). |
array("sass", "scss", "scss.css", "sass.css", "css") |
| paths |
Paths used to locate sass source files (order matters). |
array(".") |
| persist |
If true, will serve compiled css file directly. If source sass file is newer than compiled file, the sass will be re-compiled before being served. |
false |
| public |
Path used to write compiled css if persist option is true. |
getcwd() |
| parser |
Array of options passed into Sass\Parser. |
array("cache" => false) |