Node Bourbon

4.2.8 · abandoned · verified Sun Apr 19

Node Bourbon is a `node-sass` wrapper for the now-unmaintained Bourbon Sass library. It provided a convenient way for Node.js developers to integrate Bourbon's Sass mixins and functions into their projects using `node-sass` (which itself is a binding for LibSass). The package reached its last stable version, 4.2.8, in March 2016. Since then, both `node-bourbon` and the original Bourbon project by thoughtbot have been abandoned. The original Bourbon library recommends transitioning to native CSS. Consequently, `node-bourbon` is not compatible with modern Sass compilers like Dart Sass or recent versions of Node.js, making it unsuitable for new projects and difficult to maintain in existing ones.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates basic integration of `node-bourbon` with a Gulp build process using `gulp-sass` for compiling Sass files, including Bourbon's mixins.

const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass')); // Using 'sass' for modern compatibility, though node-bourbon expected node-sass
const path = require('path');

gulp.task('sass-compile', function () {
  return gulp.src('src/styles/*.scss')
    .pipe(sass({
      // The primary way to include Bourbon paths is via includePaths
      includePaths: require('node-bourbon').includePaths
      // Alternatively, to include additional directories alongside Bourbon's:
      // includePaths: require('node-bourbon').with(path.join(__dirname, 'src/components'))
    }).on('error', sass.logError))
    .pipe(gulp.dest('dist/css'));
});

// To run this, ensure you have gulp, gulp-sass, sass (Dart Sass) and node-bourbon installed.
// You'll also need a 'src/styles/main.scss' file, e.g.:
//
// /* src/styles/main.scss */
// @import "bourbon";
//
// body {
//   @include display(flex);
//   background-color: #f0f0f0;
// }
//
// Run with: `npx gulp sass-compile`

view raw JSON →