Leafo\ScssPhp\Compiler::mediaParent PHP Method

mediaParent() protected method

Media parent
protected mediaParent ( Leafo\ScssPhp\Formatter\OutputBlock $scope ) : Leafo\ScssPhp\Formatter\OutputBlock
$scope Leafo\ScssPhp\Formatter\OutputBlock
return Leafo\ScssPhp\Formatter\OutputBlock
    protected function mediaParent(OutputBlock $scope)
    {
        while (!empty($scope->parent)) {
            if (!empty($scope->type) && $scope->type !== Type::T_MEDIA) {
                break;
            }
            $scope = $scope->parent;
        }
        return $scope;
    }
Compiler