Leiningen plugin to compile SASS/SCSS files with Dart Sass
If you are looking for compatibility with SassC or older versions of Sass, look at the pre 1.0 versions.
You can install the plugin by adding lein-sass to your project.clj
file in the plugins
section:
(defproject example "1.0.0"
:plugins [[lein-sass "0.4.0"]])
You will also need to install sass
. Please see https://sass-lang.com/install/ for full installation instructions.
Here is an example of project.clj
with all the possible definitions.
You must provide a :targets
configuration, which only supports the Many-to-Many Mode. All other options are optional.
(defproject example-project "1.2.3"
:sass {:targets ["resources/sass:resources/public/css"]
;; other options (provided are default values):
;; :source-maps false
;; :style :compressed
}
To compile your files once:
$ lein sass once
To keep the compiler running and watch for changes:
$ lein sass watch
To delete all the files generated by lein-sass
$ lein sass clean
Warning: This feature is currently deprecated and will be removed in Leningen 3.0. At that time, this project will also stop supporting hooks.
The following hooks are supported by lein-sass:
$ lein compile
$ lein clean
To enable the hooks, add the following to your project.clj
file:
:hooks [leiningen.sass]
Copyright (C) 2013 Renaud Tircher, 2014 Stephan Behnke
Distributed under the Eclipse Public License, the same as Clojure.