Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

gulp-csstree

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-csstree

CSS Tree lint plugin for gulp 3

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

gulp-csstree

CSS Tree lint plugin for gulp 3

Usage

First, install gulp-csstree as a development dependency:

npm install --save-dev gulp-csstree

Then, add it to your gulpfile.js:

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

gulp.task('css', function () {
    gulp.src('./styles/*.css')
        .pipe(csstree())
        .pipe(gulp.dest('build'));
});

Options

formatter

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

gulp.task('css', function () {
    gulp.src('./styles/*.css')
        .pipe(csstree({ formatter: formatterFn }))
        .pipe(gulp.dest('build'));
});

formatterFn is a function like this:

function formatterFn(report, file) {
    // some code, that outputs a report data...
}

Formatter function will be called for every file which has an invalid css.

Fail on errors

Pipe the file stream to csstree.failAfterError() to fail on errors.

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

gulp.task('css', function () {
    gulp.src('./styles/*.css')
        .pipe(csstree())
        .pipe(csstree.failAfterError())
        .pipe(gulp.dest('build'));
});

Keywords

css

FAQs

Package last updated on 17 Sep 2016

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