Leafo\ScssPhp\Compiler::getVariables PHP Method

getVariables() public method

Returns list of variables
public getVariables ( ) : array
return array
    public function getVariables()
    {
        return $this->registeredVars;
    }

Usage Example

Example #1
0
 /**
  * Compile .scss file
  *
  * @param string $in  Input path (.scss)
  * @param string $out Output path (.css)
  *
  * @return array
  */
 protected function compile($in, $out)
 {
     $start = microtime(true);
     $css = $this->scss->compile(file_get_contents($in), $in);
     $elapsed = round(microtime(true) - $start, 4);
     $v = Version::VERSION;
     $t = date('r');
     $css = "/* compiled by scssphp {$v} on {$t} ({$elapsed}s) */\n\n" . $css;
     $etag = md5($css);
     file_put_contents($out, $css);
     file_put_contents($this->metadataName($out), serialize(['etag' => $etag, 'imports' => $this->scss->getParsedFiles(), 'vars' => crc32(serialize($this->scss->getVariables()))]));
     return [$css, $etag];
 }
Compiler