gulp-style-extract

1.0.2 • Public • Published

What is gulp-style-extract?

Gulp-style-extract is a Gulp version of style-extract, which is used for extracting only specific CSS properties and their selectors from CSS files.

Install

npm install gulp-style-extract

Options

  • properties: an array of CSS properties, that will be extracted

Usage

var gulp = require('gulp'),
    extract = require('gulp-style-extract');

gulp.task('extract', function() {
    gulp.src('lib/style.css')
     .pipe(extract({
        properties: ['color', 'background-color']
    }))
    .pipe(gulp.dest('dist'))
});

gulp.task('default', ['extract']);

Before

/* Foo */
.foo {
  background-color: #fff;
  color: #000;
  display: block;
  font-size: 12px;
}

/* Bar */
.bar {
  text-align: center;
}

After

.foo {
  background-color: #fff;
  color: #000;
}

Grunt version

The Grunt version can be found at grunt-style-extract.

Node version

The Node version can be found at style-extract.

License

MIT

Dependents (0)

Package Sidebar

Install

npm i gulp-style-extract

Weekly Downloads

8

Version

1.0.2

License

MIT

Last publish

Collaborators

  • anpsthemes