logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Mojolicious::Plugin::AssetPack::Pipe::Sass - Process sass and scss files

Attributes

functions
         $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.

       This attribute requires CSS::Sass to work. It will not get passed on to the "sass" executable.

       See "SYNOPSIS" for example.

   generate_source_map
         $bool = $self->generate_source_map;
         $self = $self->generate_source_map(1);

       This pipe will generate source maps if true. Default is "1" if "mode" in Mojolicious is "development".

       See also <http://thesassway.com/intermediate/using-source-maps-with-sass> and
       <https://robots.thoughtbot.com/sass-source-maps-chrome-magic> for more information about the usefulness.

Description

       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.

Methods

process
       See "process" in Mojolicious::Plugin::AssetPack::Pipe.

Name

       Mojolicious::Plugin::AssetPack::Pipe::Sass - Process sass and scss files

See Also

       Mojolicious::Plugin::AssetPack.

perl v5.40.0                                       2024-12-07             Mojolicious::Pl...ack::Pipe::Sass(3pm)

Synopsis

Application
         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];
           }
         });

   Sassfile
       The sass file below shows how to use the custom "image-url" function:

         body {
           background: #fff image-url('img.png') top left;
         }

See Also