CSS::Packer(3pm)
π CSS::Packer β bestie edition
okay so you want to squish CSS?? say less. this is CSS::Packer, a Perl module (lives in the User Contributed Perl Documentation section of your man pages, iykyk) and it is literally Another CSS minifier. that's the whole name, no notes.
β¨ VERSION β¨
Version 2.09 π β that's the one you're reading about rn.
πΈ DESCRIPTION πΈ
it's a fast pure Perl CSS minifier. that's it, that's the description. fast. pure Perl. minifies. slay π
π¦ SYNOPSIS π¦
here's the whole vibe:
use CSS::Packer;
my $packer = CSS::Packer->init();
$packer->minify( $scalarref, $opts );
and if you want to get a scalar back without touching the input, just do this (like, e.g. example 2):
my $ret = $packer->minify( $scalarref, $opts );
also, for backward compatibility, you can still call minify like a plain old function, no object needed:
CSS::Packer::minify( $scalarref, $opts );
the rules, bestie: the first argument must be a scalarref of CSS code. the second argument must be a hashref of options. and here are the possible options π
compressβ sets the compression level. possible values are'minify'and'pretty'. default is'pretty'. π«Ά
'pretty' turns
a {
color: black
;} div
{ width:100px;
}
into
a{
color:black;
}
div{
width:100px;
}
and 'minify' takes those same rules and gives you this:
a{color:black;}div{width:100px;}
indentβ how many spaces to use for indentation. only actually used whencompressis'pretty'. default is0. β¨copyrightβ lets you drop a copyright notice at the top of the script. πremove_copyrightβ if there's a copyright notice chilling in a comment, it only gets removed if this option is set to a true value. otherwise, the first comment containing the word "copyright" gets added at the top of the packed script. also, a copyright comment will be overwritten by a copyright notice you define with thecopyrightoption. πno_compress_commentβ if this is not set to a true value, you're allowed to set a CSS comment that stops the input from being packed, or that defines a compression level. like so:
/* CSS::Packer _no_compress_ */
/* CSS::Packer pretty */
π AUTHOR π
Merten Falk, "<nevesenin at cpan.org>". now maintained by Lee Johnson (LEEJO). π«Ά
π BUGS π
please report any bugs or feature requests through the web interface at <http://github.com/leejo/css-packer-perl/issues>. they'll be notified, and then you'll automatically be notified of progress on your bug as changes get made. the circle of life fr fr π
π SUPPORT π
you can find documentation for this module with the perldoc command.
perldoc CSS::Packer
πΈ COPYRIGHT & LICENSE πΈ
Copyright 2008 - 2011 Merten Falk, all rights reserved.
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π₯ SEE ALSO π₯
CSS::MinifierCSS::Minifier::XS
π that's the whole page bestie, go forth and minify. no cap.
this was pulled from perl v5.38.2, dated 2024-03-05, straight out of CSS::Packer(3pm) β so if your version looks different, that's why, mwah π
β¨
π¦ where this page comes from
- debian trixie: libcss-packer-perl 2.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcss-packer-perl 2.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcss-packer-perl 2.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcss-packer-perl 2.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms