Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-compass

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-compass

Compile Compass files

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.6K
increased by74.66%
Maintainers
1
Weekly downloads
 
Created
Source

Gulp compass NPM version Build Status

NPM

Compile Sass to CSS using Compass

Requirements

gulp-compass requires the compass ruby gem in order to compile compass. This can easily be installed via Terminal.

$ gem update --system
$ gem install compass

Please refer the user guide

Installation

Install with npm

$ npm install gulp-compass --save-dev

Usage

load your compass config.rb file. Please make sure css_dir and sass_dir value on config.rb file.

  • css_dir default value is css.
  • sass_dir default value is sass.

if css_dir value is stylesheets, please add css key as your define.

var compass = require('gulp-compass');

gulp.task('compass', function() {
    gulp.src('./src/*.scss')
        .pipe(compass({
            config_file: './config.rb',
            css: 'stylesheets'
        }))
        .pipe(gulp.dest('app/assets/temp'));
});

set your project path.

var compass = require('gulp-compass'),
    path = require('path');

gulp.task('compass', function() {
    gulp.src('./src/*.scss')
        .pipe(compass({
            project: path.join(__dirname, 'assets'),
            css: 'css',
            sass: 'sass'
        }))
        .pipe(gulp.dest('app/assets/temp'));
});

set your compass settings.

var compass = require('gulp-compass'),
    minifyCSS = require('gulp-minify-css');

gulp.task('compass', function() {
    gulp.src('./src/*.scss')
        .pipe(compass({
            css: 'app/assets/css',
            sass: 'app/assets/sass',
            image: 'app/assets/images'
        }))
        .pipe(minifyCSS())
        .pipe(gulp.dest('app/assets/temp'));
});

Support multiple require option

var compass = require('gulp-compass'),
    minifyCSS = require('gulp-minify-css');

gulp.task('compass', function() {
    gulp.src('./src/*.scss')
        .pipe(compass({
            css: 'app/assets/css',
            sass: 'app/assets/sass',
            image: 'app/assets/images',
            require: ['susy', 'modular-scale']
        }))
        .pipe(minifyCSS())
        .pipe(gulp.dest('app/assets/temp'));
});

Support return the output of the Compass as the callback

var compass = require('gulp-compass'),
    minifyCSS = require('gulp-minify-css');

gulp.task('compass', function() {
    gulp.src('./src/*.scss')
        .pipe(compass({
            css: 'app/assets/css',
            sass: 'app/assets/sass',
            image: 'app/assets/images'
        }))
        .on('error', function(err) {
            // Would like to catch the error here
        })
        .pipe(minifyCSS())
        .pipe(gulp.dest('app/assets/temp'));
});

Configuration

Configuration Options

style

default: nested

description: The output style for the compiled css. One of: nested, expanded, compact, or compressed.

comments

default: true

description: Show line comments or not.

relative

default: true

description: Are assets relative.

css

default: css

description: The target directory where you keep your css stylesheets. It is relative to the project option.

sass

default: sass

description: The source directory where you keep your sass stylesheets. It is relative to the project option.

javascript

default: js

description: The directory where you keep your javascripts. It is relative to the project option.

font

default: font

description: The directory where you keep your fonts. It is relative to the project option.

project

default: your project base

description: The location where all your assets are store.

logging

default: true

description: show/hide compile log message.

import_path

default: false

description: The directory where you keep external Compass plugins or extensions that you would like to make available using the @import function. Common use case would be setting this to your bower_components directory for example. It is relative to the project option.

require

default: false

format: string or array

description: Require the given Ruby library before running commands. This is used to access Compass plugins without having a project configuration file.

load_all

default: false

description: Load all the frameworks or extensions found in the FRAMEWORKS_DIR directory.

bundle_exec

default: false

description: Run compass compile with bundle exec: bundle exec compass compile.

Running tests

$ gem install sass
$ gem install compass
$ gem install susy
$ gem install modular-scale
$ npm test

Keywords

FAQs

Package last updated on 14 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc