Mojolicious::Plugin::AssetPack::Preprocessor::Scss - Preprocessor for .scss files
Mojolicious::Plugin::AssetPack::Preprocessor::Scss is a preprocessor for .scss files. This module inherits all the functionality from Mojolicious::Plugin::AssetPack::Preprocessor::Sass.
.scss
You need either the "sass" executable or the cpan module CSS::Sass to make this module work:
$ sudo apt-get install rubygems $ sudo gem install sass ... $ sudo cpanm CSS::Sass
You can force using the executable by setting the environment variable ENABLE_LIBSASS_BINDINGS to a false value.
ENABLE_LIBSASS_BINDINGS
The environment variable SASS_PATH can be used to instruct this module to search for @import files in directories other than relative to the the file containing the @import statement.
SASS_PATH
@import
Note that SASS_PATH needs to hold absolute paths to work properly.
Example usage:
local $ENV{SASS_PATH} = "/some/dir:/usr/share/other/dir"; $app->asset("app.css" => "sass/app.scss");
It is also possible to set the "include_paths" attribute instead of using global variables:
$app->asset->preprocessors->add(scss => Scss => {include_paths => [...]}); $app->asset("app.css" => "sass/app.scss");
The final list of directories to search will be:
1. dirname $main_sass_file 3. $self->include_paths() 2. split /:/, $ENV{SASS_PATH}
Compass is an open-source CSS Authoring Framework built on top of "sass". See http://compass-style.org/ for more information.
Installation on Ubuntu and Debian:
$ sudo apt-get install rubygems $ sudo gem install compass
This module will try figure out if "compass" is required to process your *.scss files. This is done with this regexp on the top level sass file:
*.scss
m!\@import\W+compass\/!;
NOTE! Compass support is experimental and you probably have to set ENABLE_LIBSASS_BINDINGS to a false value to make it work.
You can disable compass detection by setting the environment variable MOJO_ASSETPACK_NO_COMPASS to a true value.
MOJO_ASSETPACK_NO_COMPASS
$path = $self->executable;
Holds the path to the "sass" executable. Default to just "sass".
$self = $self->include_paths(\@paths); $paths = $self->include_paths;
Holds optional paths to search for where to find @import files.
Returns true if "executable" points to an actual file.
Returns the checksum for the given $text, but also checks for any @import statements and includes those files in the checksum.
$text
See "process" in Mojolicious::Plugin::AssetPack::Preprocessor.
This method use "sass" to process $text.
Copyright (C) 2014, Jan Henning Thorsen
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
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.