Download Latest Version Twig.zip (224.8 kB)
Email in envelope

Get an email when there's a new version of Blendid

Home / v4.5.1
Name Modified Size InfoDownloads / Week
Parent folder
PostCSS.tar.gz 2019-10-29 172.5 kB
PostCSS.zip 2019-10-29 223.0 kB
README.md 2019-10-29 1.8 kB
Totals: 3 Items   397.3 kB 0
  • Adds PostCSS support
  • Autoprefixer replaces gulp-autoprefixer
  • cssnano replaces gulp-cssnano

Users can configure plugins and options in task-config.js's stylesheets.postcss. See gulp-postcss for more info.

Basic usage is unchanged. Source stylesheets will be preprocessed with Sass unless stylesheets.sass is false. You can still call out Sass explicitly if you like:

:::javascript
// in task-config.js
stylesheets: true

A task-config with custom PostCSS will look like this

:::javascript
// task-config.js
// must also add the dependencies (`(npm i|yarn add) some-plugin some-option`)

var somePlugin = require('some-plugin')
var someOption = require('some-option')

var postCssPlugins = [somePlugin()]
var postCssOptions = {someOption}

module.exports = {
    // ...
    stylesheets: {
        // sass: true is implied
        postcss: {
           plugins: postCssPlugins,
           options: postCssOptions
        }
    }
    // ...
}

Autoprefixer and cssnano are injected into the PostCSS plugins list, and do not need to be specified. However custom Autoprefixer and/or cssnano configs are respected if provided. That looks like this:

:::javascript
// task-config.js
// must also add the autoprefixer dependency (`(npm i|yarn add) autoprefixer`)

var autoprefixer = require('autoprefixer')

var postCssPlugins = [
    autoprefixer({
        grid: "autoplace"
    })
]

module.exports = {
    // ...
    stylesheets: {
        // sass: true is implied
        postcss: {
           plugins: postCssPlugins
        }
    }
    // ...
}
Source: README.md, updated 2019-10-29