class ScssphpFilter

Loads SCSS files using the PHP implementation of scss, scssphp.

Scss files are mostly compatible, but there are slight differences.

@link http://leafo.net/scssphp/

@author Bart van den Burg <bart@samson-it.nl>

Hierarchy

Expanded class hierarchy of ScssphpFilter

1 file declares its use of ScssphpFilter
ScssphpFilterTest.php in drupal/core/vendor/kriswallsmith/assetic/tests/Assetic/Test/Filter/ScssphpFilterTest.php

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Filter/ScssphpFilter.php, line 25

Namespace

Assetic\Filter
View source
class ScssphpFilter implements FilterInterface {
  public function filterLoad(AssetInterface $asset) {
    $root = $asset
      ->getSourceRoot();
    $path = $asset
      ->getSourcePath();
    $lc = new \scssc();
    if ($root && $path) {
      $lc
        ->addImportPath(dirname($root . '/' . $path));
    }
    $asset
      ->setContent($lc
      ->compile($asset
      ->getContent()));
  }
  public function filterDump(AssetInterface $asset) {
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ScssphpFilter::filterDump public function Filters an asset just before it's dumped. Overrides FilterInterface::filterDump
ScssphpFilter::filterLoad public function Filters an asset after it has been loaded. Overrides FilterInterface::filterLoad