Minify CSS - Javascript

Minify CSS - Javascript

code snippet

javascript
function minifycss(css) {
    var output = css;
    var cssregex = /\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*|<!--[\s\S]*?-->$/g;
    output = output.replace(cssregex, '');
    cssregex = /([\!><:,;\{\}])[\s\n\r]+/g;
    output = output.replace(cssregex, '$1');
    cssregex = /[\s\n\r]+([\!><:,;\{\}])/g;
    output = output.replace(cssregex, '$1');
    return output.trim();
}

"What we think, we become"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.