Giter VIP home page Giter VIP logo

lein-scss's Introduction

lein-scss

A Leiningen plugin to compile an scss project to css using CLI tools. Designed to be used with the libsass binary sassc, but should work equally well with any other CLI binary that converts scss to css.

Clojars Project

Usage

Put [lein-scss "0.3.0"] into the :plugins vector of your project.clj.

Run with:

lein scss <build-keys ...> [once|auto] [boring] [quiet] [beep]
  • The auto option watches the source directory for changes and automatically compiles them.
  • The once option will compile all stylesheets and exit.
  • Add the boring option to prevent color output for use in logs.
  • Add the quiet option to prevent excessive logging.
  • Running without these options will compile all stylesheets in the source directory and then wait for changes.
  • build-keys can be one or more keywords for builds specified in the project.clj configuration, see below.

Setup

An example project.clj would look like this:

(defproject myproject "0.1.0-SNAPSHOT"
  :description "My Project"
  :dependencies [[org.clojure/clojure "1.8.0"]]
  :plugins      [[lein-scss "0.3.0"]]

  :hooks [leiningen.scss] ;; You can hook scss into the `compile`, `jar` and `uberjar` lein tasks
                          ;; You also have to enable it in a build map - see below.
  :scss {:builds
         {:develop    {:source-dir "scss/"
                       :dest-dir   "public/css/"
                       :executable "sassc"
                       :args       ["-m" "-I" "scss/" "-t" "nested"]}
          :production {:source-dir "scss/"
                       :dest-dir   "public/css/"
                       :executable "sassc"
                       :args       ["-I" "scss/" "-t" "compressed"]
                       :jar        true}
          :testremote {:source-dir "scss/"
                       :dest-dir   "public/css/"
                       :executable "sassc"
                       :args       ["-I" "scss/" "-t" "nested"]
                       :image-token "#IMAGE-URL#"
                       :image-url "https://s3.amazonaws.com/test/"
                       :font-token "#FONT-URL#"
                       :font-url "https://s3.amazonaws.com/test/fonts/"}
          :test       {:source-dir "tests/scss/"
                       :dest-dir   "/tmp/test/css/"
                       :executable "sassc"
                       :args       ["-m" "-I" "scss/" "-t" "nested"]}}}
  • :source-dir is the directory containing your .scss source files.
  • :dest-dir is the directory where .css files will be generated.
  • :executable is the path to your sass conversion binary.
  • :args is a vector of arguments to add to the executable command. The input and output file arguments will be appended to this list.
  • :jar set to true will package css in the JAR file.

When specified, :image-token and :font-token will be replaced by :image-url and :font-url in the generated css.

License

Copyright © 2014

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

lein-scss's People

Contributors

bluegray avatar uxp avatar

Watchers

Greg Leppert avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.