Exemple #1
0
 /**
  * get-local-font-weights(roboto);
  *
  * @param array $args
  * @param Compiler $compiler
  * @return string
  */
 public function userGetLocalFontWeights($args, Compiler $compiler)
 {
     $name = trim($compiler->compileValue(reset($args)), '\'"');
     $weights = isset($this->fonts[$name]) ? array_keys($this->fonts[$name]) : [];
     // Create a list of numbers so that SCSS parser can parse the list.
     $list = [];
     foreach ($weights as $weight) {
         $list[] = ['number', $weight, ''];
     }
     return ['list', ',', $list];
 }
Exemple #2
0
 /**
  * @param string $name       Name of function to unregister.
  * @return $this
  */
 public function unregisterFunction($name)
 {
     $this->compiler->unregisterFunction($name);
     return $this;
 }