This site has been acquired by
(Attention! API endpoint has changed)

CSS Minifier

Online CSS Minifier/Compressor. Free! Provides an API. Simple Quick and Fast.


Thanks to Boris Kotyrev (I've adapted what he sent to be more minimal).

use strict;
use warnings;

use File::Slurp;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

sub minify{
    my ($css) = @_;

    my $css_min_url = "";

    my $ua = LWP::UserAgent->new;
    my $request = POST($css_min_url, [ 'input' => $css ]);
    my $css_min = $ua->request($request)->decoded_content();

    return $css_min;

print minify($css, "\n");

Click on the language of your choice to see an example: