getMixin() public method

Returns a mixin
public getMixin ( string $name ) : SassMixinDefinitionNode
$name string name of mixin to return
return SassMixinDefinitionNode the mixin
Exemplo n.º 1
0
 /**
  * Parse this node.
  * Set passed arguments and any optional arguments not passed to their
  * defaults, then render the children of the mixin definition.
  * @param SassContext $pcontext the context in which this node is parsed
  * @return array the parsed node
  */
 public function parse($pcontext)
 {
     $mixin = $pcontext->getMixin($this->name);
     $context = new SassContext($pcontext);
     $context->content = $this->children;
     $argc = count($this->args);
     $count = 0;
     $args = SassScriptFunction::extractArgs($this->args, false, $context);
     list($arguments) = SassScriptFunction::fill_parameters($mixin->args, $args, $context, $this);
     $context->setVariables($arguments);
     $children = array();
     foreach ($mixin->children as $child) {
         /** @var $child SassNode */
         $child->parent = $this;
         $children = array_merge($children, $child->parse($context));
     }
     // $context->merge();
     return $children;
 }