PHPackages                             flazzarotto/sass-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. flazzarotto/sass-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

flazzarotto/sass-generator
==========================

CSS and Sourcemaps SCSS compiler service and command for Symfony3

0.2.0(9y ago)2491GPL-3.0PHP

Since Nov 3Pushed 9y ago2 watchersCompare

[ Source](https://github.com/flazzarotto/sass-generator-bundle)[ Packagist](https://packagist.org/packages/flazzarotto/sass-generator)[ RSS](/packages/flazzarotto-sass-generator/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (4)Dependencies (2)Versions (4)Used By (0)

README
======

[](#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

1. Run `composer require flazzarotto/sass-generator dev-master`
2. Modify you AppKernel.php:

    ```
    $bundles = [
      // bunch of other bundles
      new Flazzarotto\SassGeneratorBundle\SassGeneratorBundle(), //  post-install-cmd/post-update-cmd/warmup`. See below for more details about sass generator service and its command line tool.

HOW TO USE
==========

[](#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 :

1. 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 files
    - `php 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)
2. 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:

    ```
    // get the service inside a controller
    $sassGenerator = $this->get('sass_generator');

    $sassGenerator->init($sourceMaps, $lineNumbers, $precision, $format, "inputFolder:outputFolder");
    ```

    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:

    ```
    // generate css files in output folder from all scss files found in input folder.
    $sassGenerator->compileAll();

    // get all scss files found in folder
    $files = $sassGenerator->getSourceFiles();

    // compile only one file in css
    $sassGenerator->compile($file[0]); // false on failure, path to css file on success

    // compile only one file in sourcemap - css must have been generated before
    $sassGenerator->generateMap($file[0]); // false on failure, path to sourcemap file on success

    // get all warnings encountered during compilation or sourcemap generation
    $sassGenerator->getWarnings();

    // you can re-initialise the service at any time to compile another scss folder
    $sassGenerator->init(/*params*/);
    ```

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3570d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4263017?v=4)[flazzarotto](/maintainers/flazzarotto)[@flazzarotto](https://github.com/flazzarotto)

---

Top Contributors

[![flazzarotto](https://avatars.githubusercontent.com/u/4263017?v=4)](https://github.com/flazzarotto "flazzarotto (2 commits)")

---

Tags

phpcsssassscsscompilersourcemapcss.map

### Embed Badge

![Health badge](/badges/flazzarotto-sass-generator/health.svg)

```
[![Health](https://phpackages.com/badges/flazzarotto-sass-generator/health.svg)](https://phpackages.com/packages/flazzarotto-sass-generator)
```

###  Alternatives

[panique/laravel-sass

Compiles your Sass .scss files to .css every time you run your app (in development)

72174.1k1](/packages/panique-laravel-sass)[wapplersystems/ws-scss

Compiles SCSS to CSS at runtime with caching, TypoScript variables and EXT: import support

11154.7k9](/packages/wapplersystems-ws-scss)[trentrichardson/cakephp-shrink

Compiles, combines, and minifies javascript, coffee, less, scss, and css

1619.4k](/packages/trentrichardson-cakephp-shrink)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
