Migrates Blendid to PostCSS. To test, add olets/blendid#postcss as a project dependency, and confirm that stylesheets are processed correctly. Tested with CSS (source files .css, stylesheets.sass false) and Sass (source files .scss, stylesheets true), and custom PostCSS config as below)
Users can configure plugins and options in task-config.js's stylesheets.postcss. See gulp-postcss for more info.
To support Sass with default options, set stylesheets to true (the default). To not include Sass processing, set stylesheets.sass to false.
Basic usage is unchanged:
// in task-config.js
stylesheets: true
If the custom PostCSS configuration does not include cssnano, it will be added dynamically. Same for Autoprefixer. This matches the current Blendid behavior where stylesheets are run through cssnano and Autoprefixer. (Custom cssnano and Autoprefixer configurations in task-config will be respected.)
A task-config with custom PostCSS will look like this (in this example, autoprefixer, some-other-plugin, and some-option must also be added as project dependencies)
// task-config.js
var autoprefixer = require('autoprefixer')
var someOtherPlugin = require('some-other-plugin')
var someOption = require('some-option')
var postCssPlugins = [
autoprefixer({
grid: "autoplace"
}),
someOtherPlugin()
]
var postCssOptions = {someOption}
module.exports = {
// ...
stylesheets: {
// sass: true is implied
postcss: {
plugins: postCssPlugins,
options: postCssOptions
}
}
// ...
}
cc @solomonhawk — any further suggestions would be very welcome!
Migrates Blendid to PostCSS. To test, add
olets/blendid#postcss
as a project dependency, and confirm that stylesheets are processed correctly. Tested with CSS (source files.css
, stylesheets.sassfalse
) and Sass (source files.scss
, stylesheetstrue
), and custom PostCSS config as below)Users can configure
plugins
andoptions
intask-config.js
'sstylesheets.postcss
. See gulp-postcss for more info.To support Sass with default options, set
stylesheets
totrue
(the default). To not include Sass processing, setstylesheets.sass
tofalse
.Basic usage is unchanged:
If the custom PostCSS configuration does not include cssnano, it will be added dynamically. Same for Autoprefixer. This matches the current Blendid behavior where stylesheets are run through cssnano and Autoprefixer. (Custom cssnano and Autoprefixer configurations in task-config will be respected.)
A
task-config
with custom PostCSS will look like this (in this example, autoprefixer, some-other-plugin, and some-option must also be added as project dependencies)cc @solomonhawk — any further suggestions would be very welcome!