protected function cssminify($content): string
    {
        $content = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $content);
        $content = str_replace(': ', ':', $content);
        $content = str_replace(array("\r\n", "\r", "\n", "\t"), '', $content);
        $content = preg_replace("/ {2,}/", ' ', $content);
        $content = str_replace(array('} '), '}', $content);
        $content = str_replace(array('{ '), '{', $content);
        $content = str_replace(array('; '), ';', $content);
        $content = str_replace(array(', '), ',', $content);
        $content = str_replace(array(' }'), '}', $content);
        $content = str_replace(array(' {'), '{', $content);
        $content = str_replace(array(' ;'), ';', $content);
        $content = str_replace(array(' ,'), ',', $content);
        return $content;
    }
protected function cssminify($content): string
    {
        $content = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $content);
        $content = str_replace(': ', ':', $content);
        $content = str_replace(array("\r\n", "\r", "\n", "\t"), '', $content);
        $content = preg_replace("/ {2,}/", ' ', $content);
        $content = str_replace(array('} '), '}', $content);
        $content = str_replace(array('{ '), '{', $content);
        $content = str_replace(array('; '), ';', $content);
        $content = str_replace(array(', '), ',', $content);
        $content = str_replace(array(' }'), '}', $content);
        $content = str_replace(array(' {'), '{', $content);
        $content = str_replace(array(' ;'), ';', $content);
        $content = str_replace(array(' ,'), ',', $content);
        return $content;
    }
protected function cssminify ( $ content ) : string { $ content = preg_replace ( '!/\*[^*]*\*+([^/][^*]*\*+)*/!' , '' , $ content ) ; $ content = str_replace ( ': ' , ':' , $ content ) ; $ content = str_replace ( array ( "\r\n" , "\r" , "\n" , "\t" ) , '' , $ content ) ; $ content = preg_replace ( "/ {2,}/" , ' ' , $ content ) ; $ content = str_replace ( array ( '} ' ) , '}' , $ content ) ; $ content = str_replace ( array ( '{ ' ) , '{' , $ content ) ; $ content = str_replace ( array ( '; ' ) , ';' , $ content ) ; $ content = str_replace ( array ( ', ' ) , ',' , $ content ) ; $ content = str_replace ( array ( ' }' ) , '}' , $ content ) ; $ content = str_replace ( array ( ' {' ) , '{' , $ content ) ; $ content = str_replace ( array ( ' ;' ) , ';' , $ content ) ; $ content = str_replace ( array ( ' ,' ) , ',' , $ content ) ; return $ content ; }
Minify CSS. By default turned off, extend class to enable.

@author Manas Tungare  https://github.com/manastungare
@author Brenton String https://gist.github.com/brentonstrine

@link https://gist.github.com/brentonstrine/5f56a24c7d34bb2d4655

@param string $content The content to be minified.

@return string The minified content.
Minify CSS . By default turned off extend class to enable .