Search by

covaleski / sass-php

covaleski

Install and run Sass using Composer.

Package info

github.com/covaleski/sass-php

pkg:composer/covaleski/sass-php

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.3 2026-07-19 17:39 UTC

This package is auto-updated.

Last update: 2026-09-19 18:09:49 UTC


README

Run Sass binaries from Composer and compile SCSS files programatically from PHP.

Installation

Install this package using the Composer package manager:

composer require covaleski/sass-php

Usage

Use the vendor/bin/sass-php to install, update or remove Sass:

vendor/bin/sass-php install
vendor/bin/sass-php install latest
vendor/bin/sass-php install 1.101.0
vendor/bin/sass-php use 1.101.0
vendor/bin/sass-php remove 1.101.0
vendor/bin/sass-php remove all
vendor/bin/sass-php autoremove

Once a Sass binary is downloaded, use vendor/bin/sass to compile SCSS files:

vendor/bin/sass input.scss output.css

To programatically interact with Sass from PHP, use the Sass facade:

use Covaleski\SassPhp\Sass\Sass;

Sass::build()
    ->setStyle(Sass::COMPRESSED)
    ->generateSourceMap(false)
    ->setInputFile('input.scss')
    ->setOutputFile('output.css')
    ->getProcess()
    ->run();

The build() method provides a SassProcessBuilder instance, which creates a Symfony Process instance with all applicable Sass options once you call the getProcess() method.

The Sass binaries you installed using the sass-php command are automatically detected by the process builder.