PHPackages                             shyim/sasso - 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. shyim/sasso

ActivePhp-ext[Utility &amp; Helpers](/categories/utility)

shyim/sasso
===========

PHP extension wrapping the sasso pure-Rust SCSS to CSS compiler, built with ext-php-rs.

0.2.0(1mo ago)14↓50%MITPHPPHP &gt;=8.2CI failing

Since Jun 14Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/shyim/php-sasso)[ Packagist](https://packagist.org/packages/shyim/sasso)[ Docs](https://github.com/shyim/php-sasso)[ RSS](/packages/shyim-sasso/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

php-sasso
=========

[](#php-sasso)

A PHP extension that compiles **SCSS / Sass → CSS** natively, in-process, with no Node, no Dart VM, and no subprocess. It is a thin [ext-php-rs](https://github.com/davidcole1340/ext-php-rs) binding around [`sasso`](https://crates.io/crates/sasso) — a pure-Rust, zero-dependency dart-sass alternative that matches current dart-sass byte-for-byte on the subset it implements.

The loaded extension is named **`sasso`** (`extension=sasso`, `php -m` shows `sasso`, `extension_loaded('sasso')`); `php-sasso` is just the repository name.

Requirements
------------

[](#requirements)

- PHP 8.2+ (developed against 8.5)
- A Rust toolchain (`cargo`)
- `libclang` for bindgen (macOS: `brew install llvm`)

Install with PIE
----------------

[](#install-with-pie)

The package is [PIE](https://github.com/php/pie)-compatible. With a Rust toolchain available, PIE builds the extension from source (via `phpize`/`configure`/`make`, which shell out to cargo) and installs it:

```
$ pie install shyim/sasso
```

Then enable it in your `php.ini`:

```
extension=sasso
```

Build &amp; install manually
----------------------------

[](#build--install-manually)

```
$ ./install.sh
```

This builds `--release` and copies the module into `$(php-config --extension-dir)`as `sasso.so`. Then enable it in your `php.ini` with `extension=sasso.so`.

Equivalently, the PIE/pecl build flow works directly:

```
$ phpize && ./configure && make && make install
```

To try it without installing:

```
$ cargo build --release
$ php -dextension=target/release/libsasso.dylib  your_script.php   # macOS
$ php -dextension=target/release/libsasso.so     your_script.php   # Linux
```

Tests
-----

[](#tests)

The `.phpt` suite under `tests/` exercises the public API. The runner builds the extension (if needed) and runs the suite against the freshly built cdylib — it does **not** require the extension to be installed in your `php.ini`:

```
$ php tests/run.php                                   # whole suite
$ php tests/run.php tests/030-importer-two-phase.phpt # a single test
$ composer test                                       # same, via composer
```

It locates PHP's bundled `run-tests.php` automatically; override with `RUN_TESTS_PHP=/path/to/run-tests.php` if it can't be found.

Usage
-----

[](#usage)

The API is object-oriented: a single fluent `Sasso\Compiler` class.

### Fluent compiler

[](#fluent-compiler)

```
