Example #1
0
 public function compile($env)
 {
     $media = new Less_Tree_Media(array(), array(), $this->index, $this->currentFileInfo);
     $strictMathBypass = false;
     if (Less_Parser::$options['strictMath'] === false) {
         $strictMathBypass = true;
         Less_Parser::$options['strictMath'] = true;
     }
     $media->features = $this->features->compile($env);
     if ($strictMathBypass) {
         Less_Parser::$options['strictMath'] = false;
     }
     $env->mediaPath[] = $media;
     $env->mediaBlocks[] = $media;
     array_unshift($env->frames, $this->rules[0]);
     $media->rules = array($this->rules[0]->compile($env));
     array_shift($env->frames);
     array_pop($env->mediaPath);
     return !$env->mediaPath ? $media->compileTop($env) : $media->compileNested($env);
 }
Example #2
0
 public function compile($env)
 {
     $media = new Less_Tree_Media(array(), array());
     $strictMathBypass = false;
     if ($env->strictMath === false) {
         $strictMathBypass = true;
         $env->strictMath = true;
     }
     try {
         $media->features = $this->features->compile($env);
     } catch (Exception $e) {
     }
     if ($strictMathBypass) {
         $env->strictMath = false;
     }
     $env->mediaPath[] = $media;
     $env->mediaBlocks[] = $media;
     array_unshift($env->frames, $this->ruleset);
     $media->ruleset = $this->ruleset->compile($env);
     array_shift($env->frames);
     array_pop($env->mediaPath);
     return count($env->mediaPath) == 0 ? $media->compileTop($env) : $media->compileNested($env);
 }