Catalyst::View::CSS::Minifier::XS - Minify your multiple CSS files and use them with Catalyst.
Version 0.02
# creating MyApp::View::CSS ./script/myapp_create.pl view CSS CSS::Minifier::XS # in your controller file, as an action sub css : Local { my ( $self, $c ) = @_; $c->stash->{css} = [qw/style1 style2/]; # loads root/css/style1.css and root/css/style2.css $c->forward("View::CSS"); } # in your html template use <link rel="stylesheet" type="text/css" media="screen" href="/css" />
Use your minified css files as a separated catalyst request. By default they are read from $c->stash->{css} as array or string.
$c->stash->{css}
sets a different stash variable from the default $c->stash->{css}
sets a different path for your css files
default : css
setting this to true will take your css files (stash variable) from your referer action
# in your controller sub action : Local { my ( $self, $c ) = @_; $c->stash->{css} = "exclusive"; # loads exclusive.css only when /action is loaded }
This could be very dangerous since it's using $c->forward($c->request->headers->referer). It doesn't work with the index action!
$c->forward($c->request->headers->referer)
default : false
Catalyst , Catalyst::View, CSS::Minifier::XS
Ivan Drinchev <drinchev at gmail.com>
<drinchev at gmail.com>
Please report any bugs or feature requests to bug-catalyst-view-css-minifier-xs at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Catalyst-View-CSS-Minifier-XS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-catalyst-view-css-minifier-xs at rt.cpan.org
Copyright 2009 Ivan Drinchev, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::View::CSS::Minifier::XS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::CSS::Minifier::XS
CPAN shell
perl -MCPAN -e shell install Catalyst::View::CSS::Minifier::XS
For more information on module installation, please visit the detailed CPAN module installation guide.