public function cssMinify($file, $type = 'file')
    {
        $file = $this->getFile($file, $type);
        $file = $this->cleanSpaces($file);
        $file = $this->fixMaster($file);
        $file = $this->removeComments($file);

        return preg_replace(['/;[\s\r\n\t]*?}[\s\r\n\t]*/ims', '/;[\s\r\n\t]/ims', '/[\s\r\n\t]*:[\s\r\n\t][\s+\/]/ims', '/[\s\r\n\t]*,[\s\r\n\t]*?([^\s\r\n\t]\.[\s+\/])/ims', '/[\s\r\n\t]/ims', '/([\d\.]+)[\s\r\n\t]+(px|em|pt|%)/ims', '/([^\s\.]0)(px|em|pt|%|ex|mm|in|pc|vh|vw|vmin)/ims', '/\s+/'], ['}', ';$1', ',$1', '$1', '$1$2', '$1$2', ' '], $file);
    }
public function cssMinify($file, $type = 'file')
    {
        $file = $this->getFile($file, $type);
        $file = $this->cleanSpaces($file);
        $file = $this->fixMaster($file);
        $file = $this->removeComments($file);

        return preg_replace(['/;[\s\r\n\t]*?}[\s\r\n\t]*/ims', '/;[\s\r\n\t]/ims', '/[\s\r\n\t]*:[\s\r\n\t][\s+\/]/ims', '/[\s\r\n\t]*,[\s\r\n\t]*?([^\s\r\n\t]\.[\s+\/])/ims', '/[\s\r\n\t]/ims', '/([\d\.]+)[\s\r\n\t]+(px|em|pt|%)/ims', '/([^\s\.]0)(px|em|pt|%|ex|mm|in|pc|vh|vw|vmin)/ims', '/\s+/'], ['}', ';$1', ',$1', '$1', '$1$2', '$1$2', ' '], $file);
    }
public function cssMinify ( $ file , $ type = 'file' ) { $ file = $ this -> getFile ( $ file , $ type ) ; $ file = $ this -> cleanSpaces ( $ file ) ; $ file = $ this -> fixMaster ( $ file ) ; $ file = $ this -> removeComments ( $ file ) ; return preg_replace ( [ '/;[\s\r\n\t]*?}[\s\r\n\t]*/ims' , '/;[\s\r\n\t]/ims' , '/[\s\r\n\t]*:[\s\r\n\t][\s+\/]/ims' , '/[\s\r\n\t]*,[\s\r\n\t]*?([^\s\r\n\t]\.[\s+\/])/ims' , '/[\s\r\n\t]/ims' , '/([\d\.]+)[\s\r\n\t]+(px|em|pt|%)/ims' , '/([^\s\.]0)(px|em|pt|%|ex|mm|in|pc|vh|vw|vmin)/ims' , '/\s+/' ] , [ '}' , ';$1' , ',$1' , '$1' , '$1$2' , '$1$2' , ' ' ] , $ file ) ; }
Minify CSS.

@param (mixed) $file valid code.

@since 2.0.3

@return mixed
Minify CSS .