Skip to content

rufoa/sass4clj-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sass4clj-component

This is a Clojure component that performs automatic Sass->CSS compilation using sass4clj whenever you modify your Sass files. It is designed to be used with figwheel's live CSS reloading feature.

Clojars Project

Usage

The config map syntax is the same as lein-sass4clj. Valid entries are :target-path, :source-paths, :output-style and :verbosity.

Use map->SassWatcher to create the component record:

(ns example
    (:require [sass4clj-component.core :refer [map->SassWatcher]]
    ; ...

(component/system-map
   ; ...
    :sass-watcher (map->SassWatcher {:source-paths ["resources/sass"]
                                     :target-path  "resources/css"
                                     :output-style :compressed})

To read the config from your leiningen project.clj, you can use leiningen.core.project/read then get the :sass key from the map:

(ns example
   (:require [sass4clj-component.core :refer [map->SassWatcher]]
             [leiningen.core.project :as p]
   ; ...

   :sass-watcher (map->SassWatcher (:sass (p/read)))

This allows the same config to be shared between sass4clj-component and lein-sass4clj.

License

Copyright © 2016 rufoa

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published