Mojolicious::Plugin::AssetPack::Pipe::Sass - Process sass and scss files
plugin AssetPack => {pipes => [qw(Sass Css Combine)]}; $self->pipe("Sass")->functions({ q[image-url($arg)] => sub { my ($pipe, $arg) = @_; return sprintf "url(/assets/%s)", $_[1]; } });
The sass file below shows how to use the custom "image-url" function:
body { background: #fff image-url('img.png') top left; }
Mojolicious::Plugin::AssetPack::Pipe::Sass will process sass and scss files.
This module require either the optional module CSS::Sass or the sass program to be installed. sass will be automatically installed using https://rubygems.org/ unless already available.
sass
$hash_ref = $self->functions;
Used to define custom SASS functions. Note that the functions will be called with $self as the first argument, followed by any arguments from the SASS function. This invocation is EXPERIMENTAL, but will hopefully not change.
$self
This attribute requires CSS::Sass to work. It will not get passed on to the sass executable.
See "SYNOPSIS" for example.
See "process" in Mojolicious::Plugin::AssetPack::Pipe.
Mojolicious::Plugin::AssetPack.
To install Mojolicious::Plugin::AssetPack, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::AssetPack
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::AssetPack
For more information on module installation, please visit the detailed CPAN module installation guide.