Download the PHP package flazzarotto/sass-generator without Composer
On this page you can find all versions of the php package flazzarotto/sass-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sass-generator
README
This Symfony3 bundle use leafo/scssphp
and koala-framework/sourcemaps
to compile all scss files of a directory to
css in another directory. You can also generate css sourcemaps as well. It is mainly made up of a sass compiler /
sourcemap generator service and a command line tool.
Set up
-
Run
composer require flazzarotto/sass-generator dev-master
-
Modify you AppKernel.php:
- (Optional) You can automatise the sass generation by adding commands to your composer.json
in
scripts > post-install-cmd/post-update-cmd/warmup
. See below for more details about sass generator service and its command line tool.
HOW TO USE
The main goal of this package is to generate compiled css files and associated sourcemaps from a list of scss files in a symfony3 project. This can be very useful if your project must be released on cloud services such as Heroku. There are to ways to use it :
-
command line:
php bin/console sass:generate [inputFolder:outputFolder] [--source-maps] [--line-numbers] [--precision x] [--format myFormat]
- inputFolder:outputFolder : should be something like "web/[...]scssInputFolder:web/[...]cssOutputFolder" -
default value :
web/scss:web/css
- source-maps : if set it will generate source maps as well (same folder as css files)
- line-number : will generate CSS with source file line numbers
- precision : set the precision for float numbers (default sass value is 5)
- format : the format wanted in the following:
compact
,compressed
,crunched
,expanded
,nested
Examples:
php bin/console sass:generate web/scss:web/css --source-maps
will generate both compacted css and sourcemap filesphp bin/console sass:generate web/scss:web/css --line-numbers
will generate only css commented with original sass line numbers in comments (can't be used with compressed or crunched formats)php bin/console sass:generate web/scss:web/css --format compressed
will generate only minified css (can't work with source-maps option)
- inputFolder:outputFolder : should be something like "web/[...]scssInputFolder:web/[...]cssOutputFolder" -
default value :
-
Service
You can use this service if you need to be more flexible than the command tool line or if you intend to create your own command. Here's how to initialise the service:
Parameters are the same as the command line tool (set options to true to get same result). Then you will be able to use the following methods: