src/includes/classes/Core.php
protected function selfMin()
    {
        if (!$this->css) {
            return $this->css;
        }
        $static = &static::$static[__FUNCTION__.'_map'];

        if (!isset($static['replace'], $static['with'], $static['colors'])) {
            $de_spacifiables = array(
                '{',
                '}',
                '!=',
                '|=',
                '^=',
                '$=',
                '*=',
                '~=',
                '=',
                '~',
                ';',
                ',',
                '>',
            );
            $de_spacifiables = array_map(
                function ($string) {
                    return preg_quote($string, '/');
                },
                $de_spacifiables
            );
            $de_spacifiables = implode('|', $de_spacifiables);

            $static['replace'] = array(
                'comments'        => '/\/\*.*?\*\//s',
                'line_breaks'     => '/['."\r\n".']+/',
                'extra_spaces'    => '/\s{2,}/',
                'de_spacifiables' => '/ *('.$de_spacifiables.') */',
                'unnecessary_;s'  => '/;\}/',
            );
            $static['with']   = array('', ' ', ' ', '${1}', '}');
            $static['colors'] = '/(?P<context>[:,\h]+#)(?P<hex>[a-z0-9]{6})/i';
        }
        $this->css = preg_replace($static['replace'], $static['with'], $this->css);
        $this->css = preg_replace_callback($static['colors'], array($this, 'selfMaybeCompressCssColorCb'), $this->css);
        $this->css = trim($this->css);

        return $this->css;
    }
protected function selfMin()
    {
        if (!$this->css) {
            return $this->css;
        }
        $static = &static::$static[__FUNCTION__.'_map'];

        if (!isset($static['replace'], $static['with'], $static['colors'])) {
            $de_spacifiables = array(
                '{',
                '}',
                '!=',
                '|=',
                '^=',
                '$=',
                '*=',
                '~=',
                '=',
                '~',
                ';',
                ',',
                '>',
            );
            $de_spacifiables = array_map(
                function ($string) {
                    return preg_quote($string, '/');
                },
                $de_spacifiables
            );
            $de_spacifiables = implode('|', $de_spacifiables);

            $static['replace'] = array(
                'comments'        => '/\/\*.*?\*\//s',
                'line_breaks'     => '/['."\r\n".']+/',
                'extra_spaces'    => '/\s{2,}/',
                'de_spacifiables' => '/ *('.$de_spacifiables.') */',
                'unnecessary_;s'  => '/;\}/',
            );
            $static['with']   = array('', ' ', ' ', '${1}', '}');
            $static['colors'] = '/(?P<context>[:,\h]+#)(?P<hex>[a-z0-9]{6})/i';
        }
        $this->css = preg_replace($static['replace'], $static['with'], $this->css);
        $this->css = preg_replace_callback($static['colors'], array($this, 'selfMaybeCompressCssColorCb'), $this->css);
        $this->css = trim($this->css);

        return $this->css;
    }
protected function selfMin ( ) { if ( ! $ this -> css ) { return $ this -> css ; } $ static = & static :: $ static [ __FUNCTION__ . '_map' ] ; if ( ! isset ( $ static [ 'replace' ] , $ static [ 'with' ] , $ static [ 'colors' ] ) ) { $ de_spacifiables = array ( '{' , '}' , '!=' , '|=' , '^=' , '$=' , '*=' , '~=' , '=' , '~' , ';' , ',' , '>' , ) ; $ de_spacifiables = array_map ( function ( $ string ) { return preg_quote ( $ string , '/' ) ; } , $ de_spacifiables ) ; $ de_spacifiables = implode ( '|' , $ de_spacifiables ) ; $ static [ 'replace' ] = array ( 'comments' => '/\/\*.*?\*\//s' , 'line_breaks' => '/[' . "\r\n" . ']+/' , 'extra_spaces' => '/\s{2,}/' , 'de_spacifiables' => '/ *(' . $ de_spacifiables . ') */' , 'unnecessary_;s' => '/;\}/' , ) ; $ static [ 'with' ] = array ( '' , ' ' , ' ' , '${1}' , '}' ) ; $ static [ 'colors' ] = '/(?P<context>[:,\h]+#)(?P<hex>[a-z0-9]{6})/i' ; } $ this -> css = preg_replace ( $ static [ 'replace' ] , $ static [ 'with' ] , $ this -> css ) ; $ this -> css = preg_replace_callback ( $ static [ 'colors' ] , array ( $ this , 'selfMaybeCompressCssColorCb' ) , $ this -> css ) ; $ this -> css = trim ( $ this -> css ) ; return $ this -> css ; }
Self minifier.

@since 15xxxx Adding SCSS compiler.

@return string Output (minified) CSS.
Self minifier .