Mojolic...e::Sass(3)
πΈ NAME πΈ
Bestie, welcome to the user-contributed Perl documentation for Mojolicious::Plugin::AssetPack::Pipe::Sass(3) β this page is literally here to process sass and scss files β¨
β¨ 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];
}
});
π Sass file
The sass file below shows how to use the custom image-url function:
body {
background: #fff image-url('img.png') top left;
}
π¦ DESCRIPTION π¦
Mojolicious::Plugin::AssetPack::Pipe::Sass will process sass and scss files. Thatβs the whole vibe π
This module requires either the optional module CSS::Sass or the sass program to be installed. And yes, sass will be automatically installed using https://rubygems.org/ unless itβs already available β no cap π«Ά
π 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. (The page links these for the usefulness tea, iykyk β¨)
π§ METHODS π§
β process
See "process" in Mojolicious::Plugin::AssetPack::Pipe. Thatβs it, bestie β short and sweet π
π SEE ALSO π
Mojolicious::Plugin::AssetPack.
Okay thatβs the whole page, bestie!! big sparkly kisses, and credit where itβs due: perl v5.42.0, dated 2024-12-12 πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mojolicious-Plugin-AssetPack 2.150.0-bp160.1.11 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms