lein-sassc
Leiningen plugin to compile SASS/SCSS files with SassC.
This version allows specifying sassc executable by using the :executable
config key. which I have
seen in one existing version of this plugin, but not the one this was forked from.
This was done as a work-around to a problem that only appeared when launching a repl using Cursive within IntelliJ.
This version is not published to clojars so you must build and install it to maven local to use.
Installation
(defproject example "1.0.0"
:plugins [[errigal751/lein-sassc "0.10.5-SNAPSHOT"]])
Make sure you have a sassc command.
Configuration
The configuration for sassc is specified under the :sassc
sections of your project.clj
.
The :executable key is new to this version. Each sassc {} config block would need its own :executable to
override the default value of sassc
.
(defproject example "1.0.0"
:sassc [{:executable "/some/path/sassc" ;; default "sassc"
:src "src/scss/page1.scss" ;; default "src/scss/main.scss"
:output-to "dist/page1.css" ;; default "target/sassc/main.css"
:style "compressed" ;; "nested" or "compressed", default "nested"
:import-path "src/scss"} ;; default "src/scss"
{:src "src/scss/page2.scss"
:output-to "dist/page2.css"}}])
The above configuration run the following commands.
$ sassc -t compressed -I src/scss src/scss/page1.scss dist/page1.css
$ sassc -t nested -I src/scss src/scss/page2.scss dist/page2.css
Multiple source paths may be specified by setting :import-path to a vector:
(defproject example "1.0.0"
:sassc [{:src "src/scss/page1.scss" ;; default "src/scss/main.scss"
:output-to "dist/page1.css" ;; default "target/sassc/main.css"
:style "compressed" ;; "nested" or "compressed", default "nested"
:import-path ["src/scss" "other/scss"]} ;; default "src/scss"
{:src "src/scss/page2.scss"
:output-to "dist/page2.css"}}])
The above configuration results in the following commands:
$ sassc -t compressed -I src/scss -I other/scss src/scss/page1.scss dist/page1.css
$ sassc -t nested -I src/scss -I other/scss src/scss/page2.scss dist/page2.css
Usage
Compile your files once:
$ lein sassc once
To delete all the files generated by lein-sassc
$ lein sassc clean
Hooks
The following hooks are supported by lein-sassc:
$ lein compile
$ lein clean
To enable the hooks, add the following lein to your project.clj
file:
:hooks [leiningen.sassc]
License
Copyright (C) 2014 [email protected]
Distributed under the Eclipse Public License, the same as Clojure.