gulp-ccr-postcss
Transforming styles with JS plugins. A cascading configurable gulp recipe for gulp-chef.
Install
npm install --save-dev "gulpjs/gulp#4.0" gulp-chef gulp-ccr-postcss
Recipe
PostCSS
Ingredients
API
config.processors
An array or an object of processors.
If an array, items must be pre-loaded processor function; or string, and gulp-ccr-postcss will load the processor without initializing it.
If an object, property name must be processor module name, and value be pre loaded processor function; or option value, and gulp-ccr-postcss will load the processor and initialize it with the option value if it is not falsy.
In all cases, you can omit "postcss-" prefix for module names.
config.flatten
If you are not inlining css files with postcss-import
, maybe you want to remove or replace file paths.
config.sourcemaps
Options to generate sourcemaps. False to disable sourcemaps; True to generate inline sourcemaps; String to generate external sourcemaps at given dest folder.
config.syntax
Use a custom parser. Currently only supports "scss"
, note that the postcss-scss
plugin must be installed first.
config.options
Additional options to pass to postcss.
Usage
$ npm install --save-dev "gulpjs/gulp#4.0" gulp-chef gulp-ccr-postcss postcss-cssnext cssnano precss
var gulp = ;var chef = ;var meals =;gulp;
This roughly do the same thing as the following normal gulp construct:
$ npm install --save-dev "gulpjs/gulp#4.0" gulp-flatten gulp-sourcemaps gulp-if gulp-postcss postcss-cssnext cssnano precss
var gulp = ;var postcss = ;var flatten = ;var sourcemaps = ;var gulpif = ;var config =dest: 'dist/'styles: 'app/**/*.css'flatten: truesourcemaps: './';var processors =features:autoprefixer: browsers: 'last 1 version'safe: true;{return gulp;}gulp;
Use the postcss-scss plugin
$ npm install --save-dev "gulpjs/gulp#4.0" gulp-chef gulp-ccr-postcss postcss-scss cssnano
var gulp = ;var chef = ;var meals =;gulp;
Standalone
Gulp-ccr-postcss can be used as a standalone function.
var gulp = ;var postcss = ;{return;}gulp;