You are here

private function SassRuleNode::resolveParentReferences in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/tree/SassRuleNode.php \SassRuleNode::resolveParentReferences()

* Resolves parent references in the selector *

Parameters

string selector: * @return string selector with parent references resolved

1 call to SassRuleNode::resolveParentReferences()
SassRuleNode::resolveSelectors in phamlp/sass/tree/SassRuleNode.php
* Resolves selectors. * Interpolates SassScript in selectors and resolves any parent references or * appends the parent selectors. *

File

phamlp/sass/tree/SassRuleNode.php, line 283

Class

SassRuleNode
SassRuleNode class. Represents a CSS rule. @package PHamlP @subpackage Sass.tree

Code

private function resolveParentReferences($selector, $context) {
  $resolvedReferences = array();
  if (!count($this->parentSelectors)) {
    throw new SassRuleNodeException('Can not use parent selector (' . self::PARENT_REFERENCE . ') when no parent selectors', array(), $this);
  }
  foreach ($this
    ->getParentSelectors($context) as $parentSelector) {
    $resolvedReferences[] = str_replace(self::PARENT_REFERENCE, $parentSelector, $selector);
  }
  return $resolvedReferences;
}