ScssphpFilter.php

Namespace

Assetic\Filter

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Filter/ScssphpFilter.php
View source
<?php

/*
 * This file is part of the Assetic package, an OpenSky project.
 *
 * (c) 2010-2012 OpenSky Project Inc
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Assetic\Filter;

use Assetic\Asset\AssetInterface;

/**
 * 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>
 */
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) {
  }

}

Classes

Namesort descending Description
ScssphpFilter Loads SCSS files using the PHP implementation of scss, scssphp.