SASS plugin for sbt
A sbt-plugin that enables you to use SASS in your project.
The initial development of this plugin was sponsored by the Wegtam GmbH.
DEPRECATION NOTICE for Ruby-SASS!
A sass compiler needs to be installed for the plugin to work. This means
sass executable needs to be found in path. Sass can be installed
by installing sass ruby gem (minimal version 3.4.0).
% gem install sass
You can verify that sass has been installed by following command:
% sass -v
Also you should install (opitonal) compass if you want to use it:
% gem install compass
The plugin is based upon the sbt-web project therefore it should be compatible with any sbt project using sbt 0.13.8 or higher and with any version of the Play Framework 2.3 or higher.
We follow the conventions of the sbt-web project regarding the
directory layout. To simplify things
it is recommended to just use the directory
app/assets/css for sass files in projects using
the Play Framework.
Files starting with an underscore (
_) are not compiled into css files. They can of course be
referenced from other sass files via an
Add the madoushi sbt-plugins repository at bintray to your resolvers in
resolvers += "Madoushi sbt-plugins" at "https://dl.bintray.com/madoushi/sbt-plugins/"
Now you can include the plugin in
project/sbt-sass.sbt like this:
addSbtPlugin("org.madoushi.sbt" % "sbt-sass" % "VERSION")
You should use the current stable version for
Some options can be set for the plugin and the
This options tells the plugin the exact location of the
sass program. If it is available from
PATH this option doesn't have to be set.
sassExecutable in Assets := List("/home/user/.rbenv/shims/sass")
To pass additional options to
sass this setting can be used. To use
compass for example use the following:
sassOptions in Assets ++= Seq("--compass", "-r", "compass")
Defines if a minified css file (named *.min.css) should be created in addition to the unminified file for each sass file not starting with an underscore (default is true).
Disabling the minified version improves compilation speed (needs about half the time then) because each version needs a separate invocation of sass. You can alternatively use sbt-css-compress for creating the minified version only when creating a package for production.
For disabling the minified version (and improving compilation speed), use the following:
sassGenerateMinifiedOutput in Assets := false
Please refer to the contributing guide.