PHPackages                             armin/scssphp-bundle - 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. armin/scssphp-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

armin/scssphp-bundle
====================

Symfony bundle to parse scss sources at runtime.

1.2.0(4y ago)41.5k3[2 issues](https://github.com/a-r-m-i-n/scssphp-bundle/issues)MITPHPPHP &gt;=7.2.0

Since Jul 20Pushed 2y agoCompare

[ Source](https://github.com/a-r-m-i-n/scssphp-bundle)[ Packagist](https://packagist.org/packages/armin/scssphp-bundle)[ RSS](/packages/armin-scssphp-bundle/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (11)Used By (0)

ScssPHP - Symfony Bundle
========================

[](#scssphp---symfony-bundle)

This bundle for Symfony Framework (4-6), includes the [scssphp/scssphp](https://github.com/scssphp/scssphp)package, which allows you to parse SCSS sources (like Bootstrap) in your application, without need of Node.js and npm!

The ScssPHP bundle can recognize changes in SCSS source files (or Symfony configuration) automatically and only re-compiles those files. So, when you change something in your SCSS sources and refresh the application you see the results, instantly. You can disable this for the production environment.

Also, it provides a helpful debugger toolbar entry and a command which allows you to compile the SCSS sources from CLI.

It is released under MIT license.

Features
--------

[](#features)

- Compile SCSS sources (like the [Bootstrap](https://getbootstrap.com/) framework) **with pure PHP** (thanks to [scssphp/scssphp](https://github.com/scssphp/scssphp))
- Simple but powerful asset configuration (e.g. set variable values)
- Several output-formatter available (nested, compressed, crushed, etc.)
- Inline source map support
- Profiler Toolbar Debugging
- Symfony Command to compile SCSS sources on CLI
- Auto-update, when sources (or configuration) changes

Screenshots
-----------

[](#screenshots)

**ScssPHP in Symfony's profiler toolbar:**

[![ScssPHP in Symfony's profiler toolbar](docs/images/profiler-toolbar.png "ScssPHP in Symfony's profiler toolbar")](docs/images/profiler-toolbar.png)

**Hovering over ScssPHP profiler toolbar entry:**

[![Hovering over ScssPHP profiler toolbar entry.](docs/images/profiler-toolbar-hover.png "Hovering over ScssPHP profiler toolbar entry.")](docs/images/profiler-toolbar-hover.png)

**ScssPHP profiler panel:**

[![ScssPHP profiler panel.](docs/images/profiler-panel.png "ScssPHP profiler panel.")](docs/images/profiler-panel.png)

**Display of SCSS compiling errors:**

[![Display of SCSS compiling errors.](docs/images/profiler-panel-error.png "Display of SCSS compiling errors.")](docs/images/profiler-panel-error.png)

**Details of recent SCSS builds:**

[![Details of recent SCSS builds](docs/images/profiler-panel-build-details.png "Details of recent SCSS builds")](docs/images/profiler-panel-build-details.png)

**CLI command (with compiling error)**

`$ php bin/console scssphp:compile`

[![CLI command (with compiling error)](docs/images/command-with-error.png "CLI command (with compiling error)")](docs/images/command-with-error.png)

**Non-interactive CLI command**

`$ php bin/console scssphp:compile all -n`

[![Non-interactive CLI command](docs/images/command-no-interaction.png "Non-interactive CLI command")](docs/images/command-no-interaction.png)

Installation
------------

[](#installation)

To install the scssphp-bundle you can just use composer:

```
$ composer require armin/scssphp-bundle

```

The bundle also ships a [Symfony Flex Recipe](https://github.com/symfony/recipes-contrib/tree/master/armin/scssphp-bundle/1.0).

Usage and configuration
-----------------------

[](#usage-and-configuration)

The scssphp bundle is triggered, when you use the `{{ asset("...") }}` function in your Twig templates, and the requested asset is configured in `scssphp.assets` and `scssphp.enabled` is `true`.

**Example asset call in twig:**

```

```

### Example configuration

[](#example-configuration)

For this example you also need to require the Bootstrap CSS framework:

```
$ composer require twbs/bootstrap:"^5.0"
```

```
# config/packages/scssphp.yaml
scssphp:
    enabled: true
    assets:
        "css/styles.css":
            src: "assets/main.scss"
            sourceMap: true
            importPaths:
                - "vendor/twbs/bootstrap/scss"
            variables:
                primary: '#ff0066'
```

### Reference

[](#reference)

```
# On CLI: php bin/console config:dump scssphp

# Default configuration for extension with alias: "scssphp"
scssphp:

    # When disabled, ScssPHP will not compile SCSS sources automatically,
    # by user's request. Compiling with CLI tool will still work.
    enabled:              true

    # Automatically re-compile SCSS sources on updates, when enabled.
    autoUpdate:           true

    # List of SCSS assets, which should be compiled, when requested. Key is the asset name/path.
    assets:
        -
            # Path to SCSS source file (entrypoint), relative to Symfony's project directory.
            src:                  ~ # Required

            # Prepends this outputFolder to asset's destination path.
            outputFolder:         public

            # Array of import paths, relative to Symfony's project directory.
            importPaths:          []

            # Array of scss variables, which should be used during compilation. Use key => value here.
            variables:            []

            # Expanded or compressed CSS output.
            outputStyle:          compressed
            # One of:
            # - "expanded"
            # - "compressed"

            # When enabled, the CSS file contains inline sourceMap comments.
            sourceMap:            false

            # When enabled, the timestamp of the asset, will be appended as query string.
            appendTimestamp:      true
```

Upgrade notice
--------------

[](#upgrade-notice)

Since version 2.0 the option "formatter" has been replaced by "outputStyle", which may have got values "expanded" or "compressed" (default).

Support
-------

[](#support)

If you like this Symfony bundle, you can [donate some funds](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2DCCULSKFRZFU)to support further development. Thank you!

For help please visit the [issue section](https://github.com/a-r-m-i-n/scssphp-bundle/issues) on Github.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 91.9% 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 ~108 days

Recently: every ~243 days

Total

10

Last Release

1516d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.1.0

1.1.0PHP &gt;=7.2.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/355aa463a532a530009c06219f83ab8b20a9b80a2bc8995064b6d390c6427735?d=identicon)[ArminVieweg](/maintainers/ArminVieweg)

---

Top Contributors

[![a-r-m-i-n](https://avatars.githubusercontent.com/u/1275298?v=4)](https://github.com/a-r-m-i-n "a-r-m-i-n (34 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (2 commits)")[![burki](https://avatars.githubusercontent.com/u/464455?v=4)](https://github.com/burki "burki (1 commits)")

---

Tags

bundlephpscsssymfony

### Embed Badge

![Health badge](/badges/armin-scssphp-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/armin-scssphp-bundle/health.svg)](https://phpackages.com/packages/armin-scssphp-bundle)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[friendsofsymfony/comment-bundle

This Bundle provides threaded comment functionality for Symfony applications

460751.2k5](/packages/friendsofsymfony-comment-bundle)

PHPackages © 2026

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