Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/csstree/gulp-csstree
CSS Tree lint plugin for gulp 3
https://github.com/csstree/gulp-csstree
Last synced: about 1 month ago
JSON representation
CSS Tree lint plugin for gulp 3
- Host: GitHub
- URL: https://github.com/csstree/gulp-csstree
- Owner: csstree
- License: mit
- Created: 2016-09-16T12:44:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-17T11:30:12.000Z (over 8 years ago)
- Last Synced: 2024-10-30T08:39:04.302Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# gulp-csstree
> [CSS Tree](https://github.com/csstree/) lint plugin for gulp 3## Usage
First, install `gulp-csstree` as a development dependency:
```shell
npm install --save-dev gulp-csstree
```Then, add it to your `gulpfile.js`:
```js
var csstree = require('gulp-csstree');gulp.task('css', function () {
gulp.src('./styles/*.css')
.pipe(csstree())
.pipe(gulp.dest('build'));
});
```## Options
### formatter
```js
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:
```js
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.
```js
var csstree = require('gulp-csstree');gulp.task('css', function () {
gulp.src('./styles/*.css')
.pipe(csstree())
.pipe(csstree.failAfterError())
.pipe(gulp.dest('build'));
});
```