npm

Need private packages and team management tools?Check out npm Orgs. »

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

install

npm i gulp-style-extract

Downloadsweekly downloads

8

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability