Code Monkey home page Code Monkey logo

lein-sassy's Introduction

lein-sassy

Use Sass with Clojure.

  • Suports both Sass (indent-based) and SCSS (regular) syntax
  • Supports partials and imports
  • Watches for file changes

Prerequisites

lein-sassy uses JRuby, so you need to have Ruby installed. You probably already do, though. JRuby is also why the plugin should only be used as a development dependency, since you would always depend on it otherwise.

Usage

Add the plugin to your project.clj, using the appropriate version:

(defproject narwhal-endearment-manager "0.1.0-SNAPSHOT"
  :plugins [[lein-sassy "version-from-below-goes-here"]])

Clojars Project

Then add the following, using your CSS folders as appropriate.

:sass {:src "resources/app/stylesheets"
       :dst "resources/public/stylesheets"}

Finally, run lein deps to download everything.

To compile files once, use lein sass once.

To watch files for changes, use lein sass watch.

To remove generated files, run lein sass clean.

Options

The sass section in project.clj takes various options:

  • :src: The source folder, defaults to "resources/public/stylesheets"
  • :dst: The destination folder, defaults to "resources/app/stylesheets"
  • :delete-output-dir: Whether lein sass clean deletes the output directory or only included files. Defaults to true.
  • :gem-name: Defaults to "sass"
  • :gem-version: Defaults to "3.2.14"
  • :style: [:nested|:expanded|:compact|:compressed] Output style. Defaults to :nested.
  • :syntax: [:sass|:scss] Force the syntax, which is normally inferred from the file extension. Not present in defaults.

Hooks

The following hooks are supported by lein-sassy:

$ lein compile
$ lein clean

To enable the hooks, add the following to your project.clj file:

:hooks [leiningen.sass]

What to do if it doesn't work

If you have any trouble using lein-sassy, especially if there are any Ruby issues, please open an issue. This helps me out a lot, as I can get feedback from people using various platforms in order to make lein-sassy better.

To do

  • Add Autoprefixer support.
  • Add more integration tests.

Credits and License

This plugin was greatly inspired by lein-haml-sass and contains contributions from lein-sass.

Copyright Vlad-Ștefan Harbuz and distributed under the Eclipse Public License, the same as Clojure.

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.