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

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

scssphp/scssphp
===============

scssphp is a compiler for SCSS written in PHP.

v2.1.0(7mo ago)62930.2M↓33.8%90[12 issues](https://github.com/scssphp/scssphp/issues)[4 PRs](https://github.com/scssphp/scssphp/pulls)20MITPHPPHP &gt;=8.1CI failing

Since Jun 5Pushed 3mo ago14 watchersCompare

[ Source](https://github.com/scssphp/scssphp)[ Packagist](https://packagist.org/packages/scssphp/scssphp)[ Docs](https://scssphp.github.io/scssphp/)[ RSS](/packages/scssphp-scssphp/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)Dependencies (18)Versions (41)Used By (20)

scssphp
=======

[](#scssphp)

###

[](#httpsscssphpgithubioscssphp)

[![Build](https://github.com/scssphp/scssphp/workflows/CI/badge.svg)](https://github.com/scssphp/scssphp/workflows/CI/badge.svg)[![License](https://camo.githubusercontent.com/1fc4ee7490724305ee3cb3722bb78cdcde20c61e2c1b2dbd81138b8a34deb01a/68747470733a2f2f706f7365722e707567782e6f72672f736373737068702f736373737068702f6c6963656e7365)](https://packagist.org/packages/scssphp/scssphp)

`scssphp` is a compiler for SCSS written in PHP.

Checkout the homepage, , for directions on how to use.

Running Tests
-------------

[](#running-tests)

`scssphp` uses [PHPUnit](https://github.com/sebastianbergmann/phpunit) for testing.

Run the following command from the root directory to run every test:

```
vendor/bin/phpunit tests

```

There are several tests in the `tests/` directory:

- `ApiTest.php` contains various unit tests that test the PHP interface.
- `ExceptionTest.php` contains unit tests that test for exceptions thrown by the parser and compiler.
- `FailingTest.php` contains tests reported in Github issues that demonstrate compatibility bugs.
- `InputTest.php` compiles every `.scss` file in the `tests/inputs` directory then compares to the respective `.css` file in the `tests/outputs` directory.
- `SassSpecTest.php` extracts tests from the `sass/sass-spec` repository.

When changing any of the tests in `tests/inputs`, the tests will most likely fail because the output has changed. Once you verify that the output is correct you can run the following command to rebuild all the tests:

```
BUILD=1 vendor/bin/phpunit tests

```

This will compile all the tests, and save results into `tests/outputs`. It also updates the list of excluded specs from sass-spec.

To enable the full `sass-spec` compatibility tests:

```
TEST_SASS_SPEC=1 vendor/bin/phpunit tests

```

Coding Standard
---------------

[](#coding-standard)

`scssphp` source conforms to [PSR12](https://www.php-fig.org/psr/psr-12/).

Run the following command from the root directory to check the code for "sniffs".

```
vendor/bin/phpcs --standard=PSR12 --extensions=php bin src tests

```

Static Analysis
---------------

[](#static-analysis)

`scssphp` uses [phpstan](https://phpstan.org/) for static analysis.

Run the following command from the root directory to analyse the codebase:

```
make phpstan

```

As most of the codebase is composed of legacy code which cannot be type-checked fully, the setup contains a baseline file with all errors we want to ignore. In particular, we ignore all errors related to not specifying the types inside arrays when these arrays correspond to the representation of Sass values and Sass AST nodes in the parser and compiler. When contributing, the proper process to deal with static analysis is the following:

1. Make your change in the codebase
2. Run `make phpstan`
3. Fix errors reported by phpstan when possible
4. Repeat step 2 and 3 until nothing gets fixed anymore at step 3
5. Run `make phpstan-baseline` to regenerate the phpstan baseline

Additions to the baseline will be reviewed to avoid ignoring errors that should have been fixed.

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance72

Regular maintenance activity

Popularity72

Solid adoption and visibility

Community53

Growing community involvement

Maturity80

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~60 days

Recently: every ~115 days

Total

40

Last Release

225d ago

Major Versions

1.x-dev → v2.0.02024-12-23

PHP version history (3 changes)1.0.0PHP ^5.6.0 || ^7

1.0.4PHP &gt;=5.6.0

v2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/75c5d927b0434111db9720dd78af8c83385cf28bb9aeafd031ba8cb0c4ffc558?d=identicon)[Stof](/maintainers/Stof)

![](https://www.gravatar.com/avatar/bdee67d29c3391bdda34f2255b1bb2200f23295c57de075cd93c50e3822ee7b5?d=identicon)[vipsoft](/maintainers/vipsoft)

---

Top Contributors

[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (1034 commits)")[![robocoder](https://avatars.githubusercontent.com/u/922051?v=4)](https://github.com/robocoder "robocoder (718 commits)")[![Cerdic](https://avatars.githubusercontent.com/u/342805?v=4)](https://github.com/Cerdic "Cerdic (440 commits)")[![leafo](https://avatars.githubusercontent.com/u/15198?v=4)](https://github.com/leafo "leafo (219 commits)")[![oyejorge](https://avatars.githubusercontent.com/u/1043524?v=4)](https://github.com/oyejorge "oyejorge (20 commits)")[![clue](https://avatars.githubusercontent.com/u/776829?v=4)](https://github.com/clue "clue (15 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (14 commits)")[![dleffler](https://avatars.githubusercontent.com/u/83437?v=4)](https://github.com/dleffler "dleffler (6 commits)")[![TimWolla](https://avatars.githubusercontent.com/u/209270?v=4)](https://github.com/TimWolla "TimWolla (5 commits)")[![vladimmi](https://avatars.githubusercontent.com/u/891830?v=4)](https://github.com/vladimmi "vladimmi (4 commits)")[![devdot](https://avatars.githubusercontent.com/u/3763567?v=4)](https://github.com/devdot "devdot (4 commits)")[![gwillings](https://avatars.githubusercontent.com/u/4246446?v=4)](https://github.com/gwillings "gwillings (3 commits)")[![nextend](https://avatars.githubusercontent.com/u/4518540?v=4)](https://github.com/nextend "nextend (3 commits)")[![okj579](https://avatars.githubusercontent.com/u/40447?v=4)](https://github.com/okj579 "okj579 (3 commits)")[![cedric-anne](https://avatars.githubusercontent.com/u/33253653?v=4)](https://github.com/cedric-anne "cedric-anne (3 commits)")[![shyim](https://avatars.githubusercontent.com/u/6224096?v=4)](https://github.com/shyim "shyim (3 commits)")[![caiosm1005](https://avatars.githubusercontent.com/u/4460538?v=4)](https://github.com/caiosm1005 "caiosm1005 (3 commits)")[![brainfoolong](https://avatars.githubusercontent.com/u/1684236?v=4)](https://github.com/brainfoolong "brainfoolong (3 commits)")[![micranet](https://avatars.githubusercontent.com/u/5610284?v=4)](https://github.com/micranet "micranet (2 commits)")[![sergeylukin](https://avatars.githubusercontent.com/u/720339?v=4)](https://github.com/sergeylukin "sergeylukin (2 commits)")

---

Tags

hacktoberfestphpsassscsscsssassscsslessstylesheet

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[wikimedia/less.php

PHP port of the LESS processor

12329.5M133](/packages/wikimedia-lessphp)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[efficiently/larasset

Larasset is a library for Laravel 5 which manage assets in an easy way.

684.8k](/packages/efficiently-larasset)[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)
