private function SassRuleNode::resolveParentReferences in Sassy 7.3
Same name and namespace in other branches
- 7 phamlp/sass/tree/SassRuleNode.php \SassRuleNode::resolveParentReferences()
Resolves parent references in the selector
Parameters
string selector:
Return value
string selector with parent references resolved
1 call to SassRuleNode::resolveParentReferences()
- SassRuleNode::resolveSelectors in phpsass/
tree/ SassRuleNode.php - Resolves selectors. Interpolates SassScript in selectors and resolves any parent references or appends the parent selectors.
File
- phpsass/
tree/ SassRuleNode.php, line 293
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', $this);
}
foreach ($this
->getParentSelectors($context) as $parentSelector) {
$resolvedReferences[] = str_replace(self::PARENT_REFERENCE, $parentSelector, $selector);
}
return $resolvedReferences;
}