Пример #1
0
 protected function compress()
 {
     try {
         try {
             return Process::cleancss([], parent::compress());
         } catch (Exceptions\BadInterpreter $e) {
             $args = ['-s', '-f', '-t', '--unix-newlines', '-t', 'compressed', '--scss'];
             return Process::sass($args, parent::compress());
         }
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }
Пример #2
0
 protected function filter()
 {
     $args = ['-fl', '--unix-newlines', '-t', 'expanded', '-E', 'UTF-8'];
     if ($this->extension() === 'scss') {
         $args[] = '--scss';
     }
     $args[] = $this->absolutePath();
     try {
         return preg_replace('`^@charset\\b.*?[\\r\\n]+`', '', Process::sass($args));
     } catch (Exceptions\ProcessFailure $e) {
         throw new Exceptions\SyntaxError($this, $e->error);
     }
 }