PostCSS Plugin

Description

Allows using PostCSS, A tool for transforming CSS with JavaScript.

Install

yarn add postcss --dev
// OR
npm install postcss --save-dev

Usage

check PostCSS website for more information.

Note

The PostCSS plugin generates CSS, Therefor it must be chained prior to the CSSPlugin to be used.

Setup

Import from FuseBox

const {PostCSSPlugin} = require("fuse-box");

Inject into a chain.

fuse.plugin(
     [PostCSSPlugin(), CSSPlugin()]
)

Or add it to the main config plugins list to make it available across bundles.

FuseBox.init({
    plugins : [
         [PostCSSPlugin(), CSSPlugin()]
    ]
});

Require file in your code

import "./styles/main.css"

Options

PostCSSPlugin accepts a key/value PostCSS object options as a parameter. For example:

var nested = require('postcss-nested');
var sugarss = require('sugarss');

fuse.plugin(
    [PostCSSPlugin({
       plugins, { parser: sugarss }
    }), CSSPlugin()]
)