node-neat

node-sass port of Thoughtbot's Neat library

npm install node-neat
11 downloads in the last day
232 downloads in the last week
956 downloads in the last month

Bourbon Neat

This is a node-sass port of the Neat library. If you are looking for the original Ruby/Rails version, you can find it here.

Requirements

Installation

To install as a development dependency, run:

npm install --save-dev node-neat

If you need it for production, replace --save-dev with --save.

Usage

The includePaths property returns an array of paths for use in node-sass' includePaths option.

var neat = require('node-neat').includePaths;

You can then use this array in your options:

var sass = require('node-sass')
  , neat = require('node-neat').includePaths;

var paths = ['other/path', 'another/path'].concat(neat);

sass.render({
  file: './application.scss',
  success: function(css){
    console.log(css);
  },
  error: function(error) {
    console.log(error);
  },
  includePaths: paths,
  outputStyle: 'compressed'
});

Neat depends on Bourbon, so it's included as an npm dependency and passes along node-bourbon's load path when accessing node-neat's includePaths property. Import Bourbon & then Neat at the beginning of your main scss file.

@import "bourbon";
@import "neat";
@import "other/scss/partial";

Grunt Usage

Using the grunt-sass task:

grunt.initConfig({
  sass: {
    dist: {
      options: {
        includePaths: require('node-neat').includePaths
      },
      files: {
        'path/to/output.css': 'path/to/input.scss'
      }
    }
  }
});

Using the grunt-contrib-sass task:

grunt.initConfig({
  sass: {
    dist: {
      options: {
        loadPath: require('node-neat').includePaths
      },
      files: {
        'path/to/output.css': 'path/to/input.scss'
      }
    }
  }
});

Testing

make test

Credits

This node-sass port is maintained by Michael LaCroix, however all credits for the Neat library go to thoughtbot, inc:

thoughtbot

Bourbon is maintained and funded by thoughtbot, inc. Tweet your questions or suggestions at @kaishin and @kylefiedler.

License

node-neat is Copyright © 2013 Michael LaCroix. It is free software, and may be redistributed under the terms specified in the LICENSE file.

npm loves you