GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing scssphp.github.io — SCSS Compiler in PHP - scssphp

scssphp

Quickstart · Docs · Community Guidelines

scssphp is a compiler for Sass written in PHP.

Sass is a CSS preprocessor language that adds many features like variables, mixins, imports, nesting, color manipulation, functions, and control directives.

scssphp is ready for inclusion in any project.

Installing

The officially supported way of installing scssphp is by using Composer:

composer require scssphp/scssphp "^2.1.0"

scssphp requires PHP version 8.1 (or above).

Language Reference

For a complete guide to the syntax of Sass, consult the official documentation.

Note that scssphp does not support Sass modules yet.

SCSSPHP Library Reference

To use the scssphp library use your composer generated autoloader, and then invoke the \ScssPhp\ScssPhp\Compiler class:

require "vendor/autoload.php";

use ScssPhp\ScssPhp\Compiler;

$compiler = new Compiler();

echo $compiler->compileString('
  $color: #abc;
  div { color: lighten($color, 20%); }
')->getCss();

The compileString method takes the SCSS source code as a string and an optional path of the input file (to resolve relative imports), and returns a CompilationResult value object containing the CSS and some additional data. If there is an error when compiling, a \ScssPhp\ScssPhp\Exception\SassException is thrown with an appropriate message.

For a more detailed guide, consult the documentation.

Issues

Please submit bug reports and feature requests to the issue tracker. Pull requests are also welcome.

Any feature request about implementing new language feature will be rejected. They must be submitted to the upstream Sass project instead.

Changelog

For a list of scssphp changes, refer to the changelog.

Copyright © 2015 Leaf Corcoran · Released under MIT License
Generated by jekyll on Tue Sep 15, 2026 10:23:01
Fork me on GitHub
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.