-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ai/readme
Clean up README.md
- Loading branch information
Showing
1 changed file
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
gulp-postcss | ||
============ | ||
|
||
[PostCSS](https://github.com/postcss/postcss) gulp plugin | ||
[PostCSS](https://github.com/postcss/postcss) gulp plugin to process CSS throw | ||
several processors, but parse CSS only once. | ||
|
||
## Basic usage | ||
|
||
``` | ||
```js | ||
var postcss = require('gulp-postcss') | ||
var gulp = require('gulp') | ||
var autoprefixer = require('autoprefixer') | ||
var mqpacker = require('css-mqpacker') | ||
var csswring = require('csswring') | ||
|
||
gulp.task('css', function () { | ||
var processors = [ | ||
autoprefixer('last 1 version').postcss | ||
, mqpacker.processor | ||
, csswring.postcss | ||
] | ||
return gulp.src('./src/*.css') | ||
.pipe(postcss(processors)) | ||
.pipe(gulp.dest('./dest')) | ||
}) | ||
var processors = [ | ||
autoprefixer('last 1 version').postcss, | ||
mqpacker.processor, | ||
csswring.postcss | ||
]; | ||
return gulp.src('./src/*.css') | ||
.pipe(postcss(processors)) | ||
.pipe(gulp.dest('./dest')); | ||
}); | ||
``` | ||
|
||
## Source map support | ||
|
||
Source map is inlined by default, to extract map use together | ||
with [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps). | ||
|
||
``` | ||
```js | ||
return gulp.src('./src/*.css') | ||
.pipe(sourcemaps.init()) | ||
.pipe(postcss(processors)) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('./dest')) | ||
.pipe(sourcemaps.init()) | ||
.pipe(postcss(processors)) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('./dest')); | ||
``` |