titanscssc::compileMedia PHP Method

compileMedia() protected method

protected compileMedia ( $media )
    protected function compileMedia($media)
    {
        $this->pushEnv($media);
        $parentScope = $this->mediaParent($this->scope);
        $this->scope = $this->makeOutputBlock("media", array($this->compileMediaQuery($this->multiplyMedia($this->env))));
        $parentScope->children[] = $this->scope;
        // top level properties in a media cause it to be wrapped
        $needsWrap = false;
        foreach ($media->children as $child) {
            $type = $child[0];
            if ($type !== 'block' && $type !== 'media' && $type !== 'directive') {
                $needsWrap = true;
                break;
            }
        }
        if ($needsWrap) {
            $wrapped = (object) array("selectors" => array(), "children" => $media->children);
            $media->children = array(array("block", $wrapped));
        }
        $this->compileChildren($media->children, $this->scope);
        $this->scope = $this->scope->parent;
        $this->popEnv();
    }
titanscssc