<NME> README.md
<BEF> # suitcss-preprocessor

[![Build Status](https://travis-ci.org/suitcss/preprocessor.svg?branch=master)](https://travis-ci.org/suitcss/preprocessor) [![Build status](https://ci.appveyor.com/api/projects/status/txiwk8cppv3eno3x?svg=true)](https://ci.appveyor.com/project/simonsmith/preprocessor)

[SUIT CSS](https://github.com/suitcss/suit) preprocessor.

Provides a CLI and Node.js interface for a preprocessor that combines
various [PostCSS](https://github.com/postcss/postcss) plugins.

Compiles CSS packages with:

* [postcss-easy-import](https://github.com/TrySound/postcss-easy-import)
* [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties)
* [postcss-calc](https://github.com/postcss/postcss-calc)
* [postcss-autoreset](https://github.com/maximkoretskiy/postcss-autoreset)
* [postcss-color-function](https://github.com/postcss/postcss-color-function)
* [postcss-apply](https://github.com/pascalduez/postcss-apply)
* [postcss-custom-media](https://github.com/postcss/postcss-custom-media)
* [autoprefixer](https://github.com/postcss/autoprefixer)

Each imported file is linted with [postcss-bem-linter](https://github.com/postcss/postcss-bem-linter) and [stylelint](http://stylelint.io/). Minification is provided by [cssnano](http://cssnano.co/).

Additional plugins can be added via the configuration options.

## Installation

```
npm install suitcss-preprocessor
```

## Usage

```
suitcss input.css output.css
```

## API

### Command Line

Options are [documented below](#options)

```
Usage: suitcss [<input>] [<output>]

Options:

  -h, --help                output usage information
  -c, --config [path]       a custom PostCSS config file
  -i, --import-root [path]  the root directory for imported css files
  -s, --encapsulate         encapsulate component styles
  -w, --watch               watch the input file and any imports for changes
  -m, --minify              minify output with cssnano
  -e, --throw-error         throw an error when any warnings are found
  -L, --no-lint             disable stylelint and postcss-bem-linter
  -v, --verbose             log verbose output for debugging
  -V, --version             output the version number

Examples:

  # pass an input and output file:
  $ suitcss input.css output.css

  # configure the import root directory:
  $ suitcss --import-root src/css input.css output.css

  # watch the input file and imports for changes:
  $ suitcss --watch input.css output.css

  # configure postcss plugins with a config file:
  $ suitcss --config config.js input.css output.css

  # unix-style piping to stdin and stdout:
  $ cat input.css | suitcss | grep background-color
```

### Node.js

Returns a [PostCSS promise](http://api.postcss.org/LazyResult.html)

```js
preprocessor(css: String [, options: Object] [, filename: String]);
```

* `css`: CSS input (_required_)
* `options`: Options to the preprocessor (see below) (_optional_)
* `filename`: Filename of the input CSS file (_optional_)

#### Example

```js
var preprocessor = require('suitcss-preprocessor');
var fs = require('fs');

var filename = 'src/components/index.css';
var css = fs.readFileSync(filename, 'utf8');

preprocessor(css, {
  root: 'path/to/css',
  minify: true,
}, filename).then(function(result) {
  fs.writeFileSync('build/bundle.css', result.css);
});
```

### Options

#### `root`

* Type: `String`
* Default: `process.cwd()`

Where to resolve imports from. Passed to [`postcss-import`](https://github.com/postcss/postcss-import/blob/master/README.md#root).

#### `debug`

* Type: `Function`
* Default: identity (it does nothing)

Before preprocessing `debug` is invoked on the postcss `plugins` array.
This allows you to pass a [`postcss-debug`](https://www.npmjs.com/package/postcss-debug) instance.
}
```

This works the same with the CLI `-l` flag

##### `minify`

  debug.inspect();
});
```

N.B. `debug` should always take one argument that is `plugins` and eventually return it:

```javascript
function debug(plugins) {
  // do something with plugins here
  return plugins;
}
```

#### `encapsulate`

_(experimental)_

* Type: `Boolean`
* Default: `false`

Resets CSS properties to their [initial values](https://developer.mozilla.org/en-US/docs/Web/CSS/initial_value)
to effectively allow a component to opt out of CSS inheritance and be
encapsulated from the rest of the application similar to [the Shadow DOM](https://www.w3.org/TR/shadow-dom/).
There are two types of CSS properties that affect components, inherited (e.g.
`font-size,` `color`) and non-inherited (e.g. `margin`, `background`). This
option works so that:

* Root elements (e.g. `.Component`) have both inherited and non-inherited
  properties reset to default values.
* Descendants (e.g. `.Component-item`) only have non-inherited properties reset
  as this allows properties set on the root element to be inherited by its
  descendants.

This means that components are isolated from styles outside the component root
element but should an inheritable property such as `font-size` be applied on the
component root element it will be inherited by the component descendants as
normal. This prevents the need to redeclare properties on every descendant in a
component.

The same rules also apply to nested components.

**Rationale**

One of the difficulties with CSS components is predictability. Unwanted styles
can be inherited from parent components and this can make it difficult to
reuse components in different contexts.

Methodologies such as SUIT and BEM exist to solve problems around the cascade
and specificity but they cannot protect components from inheriting unwanted
styles. What would really help is to allow inheritance to be 'opt-in' and let
component authors decide what properties are inherited. This creates a more
predictable baseline for styling components and promoting easier
reuse.

* [Component Based Style Reuse](https://youtu.be/_70Yp8KPXH8?t=27m45s)
* [React: CSS in JS](http://blog.vjeux.com/2014/javascript/react-css-in-js-nationjs.html)

**Examples**

* [CodePen encapsulate](http://codepen.io/simonsmith/pen/BLOyAX) - Demonstrates
  how components are encapsulated from global and parent styles.
* [CodePen encapsulate inheritance](http://codepen.io/simonsmith/pen/LRgxdp) -
  Similar to above but shows how components can opt-in to inheritance.

**What about `all: initial`?**

The `all: initial` declaration will reset both inherited and non-inherited
properties but this can be too forceful. For example `display` is reset to
`inline` on block elements and as mentioned earlier, descendants of a component
should only have non-inherited properties reset to allow declarations to be
inherited from the root element.

> For example, if an author specifies `all: initial` on an element it will block
  all inheritance and reset all properties, as if no rules appeared in the
  author, user, or user-agent levels of the cascade.

https://www.w3.org/TR/css3-cascade/#all-shorthand

Instead a subset of properties are reset to allow more
granular control over what parts of a component use inheritance.

To achieve this the preprocessor uses
[postcss-autoreset](https://github.com/maximkoretskiy/postcss-autoreset) with
the SUIT preset and a [custom set of CSS properties](lib/encapsulation.js) that
are reset to their initial values. **Only selectors conforming** to the SUIT naming
conventions are affected.

**Caveats**

##### Selectors must be present in the component CSS

If an element is present in the HTML but not styled in the component CSS
(perhaps relying on utility classes) it will not be reset. In
this instance an empty ruleset can be added to ensure it is correctly reset:

```html
<div class="Component u-posRelative u-textCenter">
  <div class="Component-item"></div>
</div>
```
```css
/**
 * Empty ruleset required.
 * Note the disabling of stylelint
 */

/* stylelint-disable-next-line block-no-empty */
.Component {}

.Component-item {
  color: red;
}
```

##### Global styles can still override descendants

Because component descendants only have non-inheritable properties reset it can
lead to specific global rules still applying:

```css
/* global.css */
span {
  color: red;
}

/* component.css */
.Component-text {
  font-style: bold;
}
```
```html
<div class="Component">
  <span class="Component-text">
    <!-- this text is red -->
  <span>
</div>
```

The solution to this is to minimise or avoid entirely the use of global styles
which is the recommended approach in a SUIT CSS application.

#### `lint`

* Type: `Boolean`
* Default: `true`

Ensure code conforms to the [SUIT code style](https://github.com/suitcss/suit/blob/master/doc/STYLE.md)
by using the [stylelint-config-suitcss](https://github.com/suitcss/stylelint-config-suitcss) package.

Stylelint [configuration
options](http://stylelint.io/?/docs/user-guide/configuration.md) can also be
overridden but this requires the `stylelint-config-suitcss` to be installed
locally in your package.

```js
{
  stylelint: {
    extends: 'stylelint-config-suitcss',
    rules: {
      indentation: [4, 'tab'],
    }
  }
}
```

#### `minify`

* Type: `Boolean`
* Default: `false`

If set to `true` then the output is minified by [`cssnano`](http://cssnano.co/).

#### `postcss`

* Type: `Object`
* Default: `undefined`

Options that are passed directly to `postcss`, as per [the documentation](http://api.postcss.org/global.html#processOptions).

```js
{
  postcss: {from: 'filename.css'}
}
```

##### `use`

* Type: `Array`
* Default: `undefined`

A list of plugins that are passed to PostCSS. This can be used to add new plugins and/or reorder the defaults

```js
{
  use: ['postcss-at2x', 'postcss-property-lookup']
}
```

#### `<plugin-name>`

* Type: `Object`
* Default: `undefined`

Property matching the name of a PostCSS plugin that has options for that plugin

```js
{
  autoprefixer: {
    browsers: ['> 1%', 'IE 7'],
    cascade: false
  },
  'postcss-calc': { preserve: true }
}
```

### Plugin configuration

Creating a configuration file allows options to be passed to the individual PostCSS plugins. It can be passed to the `suitcss` CLI via the `-c` flag and can be either JavaScript or JSON

```js
module.exports = {
  root: 'path/to/css',
  autoprefixer: { browsers: ['> 1%', 'IE 7'], cascade: false },
  'postcss-calc': { preserve: true }
}
```

```js
{
  "root": "path/to/css",
  "autoprefixer": { "browsers": ["> 1%", "IE 7"], "cascade": false },
  "postcss-calc": { "preserve": true }
}
```

Options are merged recursively with the defaults. For example, adding new plugins to the `use` array will result in them being merged alongside the existing ones.

#### Adding additional plugins

By default the preprocessor uses all necessary plugins to build SUIT components. However additional plugins can be installed into a project and then added to the `use` array. They will be appended to the existing list of plugins.

**Note**: This will not work with the preprocessor installed globally. Instead rely on the convenience of `npm run script`

```js
module.exports = {
  use: [
    'postcss-property-lookup'
  ]
};
```

```js
{
  "name": "my-pkg",
  "version": "0.1.0",
  "dependencies": {
    "postcss-property-lookup": "^1.1.3",
    "suitcss-preprocessor": "^0.5.0"
  },
  "scripts": {
    "preprocess": "suitcss -c myconfig.js index.css build/built.css"
  }
}
```

```
npm run preprocess
```

#### Changing plugin order

If duplicate plugins are used they will be removed, but the new order will be respected. This is useful if you need to change the default order:

```js
// Default order
var defaults = [
  'postcss-custom-properties',
  'postcss-calc',
  'postcss-color-function',
  'postcss-custom-media',
  'postcss-apply',
];

// config
module.exports = {
  use: [
    'postcss-at2x',
    'postcss-calc',
  ]
};

var result = [
  'postcss-custom-properties',
  'postcss-color-function',
  'postcss-custom-media',
  'postcss-apply',
  'postcss-at2x',
  'postcss-calc',
];
```

**Note** Some core plugins such as `postcss-easy-import` and `autoprefixer`
cannot be re-ordered. This is to ensure components are preprocessed correctly.

#### Autoprefixer: vendor prefixes

By default the preprocessor uses the SUIT
[browserslist](https://github.com/ai/browserslist) configuration:

```
> 1%, last 2 versions, safari > 6, ie > 9, ios > 6, android > 4.3, samsung > 3, chromeandroid > 50
```

The preprocessor doesn't attempt to find any `browserslist` config file.

Instead you can customise the browsers list
via [configuration file](#plugin-configuration).


## Acknowledgements

Based on [Myth](https://github.com/segmentio/myth) by Segment.io.

<MSG> Update README

<DFF> @@ -122,7 +122,9 @@ project root. For example:
 }
 ```
 
-This works the same with the CLI `-l` flag
+This would also need the [stylelint-config-suitcss](https://github.com/stylelint/stylelint-config-suitcss) package to be installed.
+
+**Note**: This works the same with the CLI `-l` flag.
 
 ##### `minify`
 

{'commit': 'diff --git a/README.md b/README.md\nindex 92d2f85..abfe3ba 100644\n--- a/README.md\n+++ b/README.md\n@@ -122,7 +122,9 @@ project root. For example:\n }\n ```\n \n-This works the same with the CLI `-l` flag\n+This would also need the [stylelint-config-suitcss](https://github.com/stylelint/stylelint-config-suitcss) package to be installed.\n+\n+**Note**: This works the same with the CLI `-l` flag.\n \n ##### `minify`\n \n', 'commit_subject': 'Update README', 'repo_name': 'suitcss/preprocessor', 'committer': {'name': 'Simon Smith', 'email': 'b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@simonsmith.io', 'time_sec': '1449072779', 'tz_offset': '0', 'date': {'seconds': '1449072779'}}, 'commit_tree': 'bf700c1bd6454597d3da0d2c5a0d7a69e7943447', 'commit_message': 'Update README\n', 'language_name': 'JavaScript', 'license': 'mit', 'hunks': '@@ -122,7 +122,9 @@ project root. For example:\n }\n ```\n \n-This works the same with the CLI `-l` flag\n+This would also need the [stylelint-config-suitcss](https://github.com/stylelint/stylelint-config-suitcss) package to be installed.\n+\n+**Note**: This works the same with the CLI `-l` flag.\n \n ##### `minify`\n \n', 'addition_count': 3, 'deletion_count': 1, 'src_file': 'a/README.md', 'tgt_file': 'b/README.md', 'file_extension': '.md', 'before_file': '# suitcss-preprocessor\n\n[![Build Status](https://travis-ci.org/suitcss/preprocessor.svg?branch=master)](https://travis-ci.org/suitcss/preprocessor) [![Build status](https://ci.appveyor.com/api/projects/status/txiwk8cppv3eno3x?svg=true)](https://ci.appveyor.com/project/simonsmith/preprocessor)\n\n[SUIT CSS](https://github.com/suitcss/suit) preprocessor.\n\nProvides a CLI and Node.js interface for a preprocessor that combines\nvarious [PostCSS](https://github.com/postcss/postcss) plugins.\n\nCompiles CSS packages with:\n\n* [postcss-easy-import](https://github.com/TrySound/postcss-easy-import)\n* [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties)\n* [postcss-calc](https://github.com/postcss/postcss-calc)\n* [postcss-autoreset](https://github.com/maximkoretskiy/postcss-autoreset)\n* [postcss-color-function](https://github.com/postcss/postcss-color-function)\n* [postcss-apply](https://github.com/pascalduez/postcss-apply)\n* [postcss-custom-media](https://github.com/postcss/postcss-custom-media)\n* [autoprefixer](https://github.com/postcss/autoprefixer)\n\nEach imported file is linted with [postcss-bem-linter](https://github.com/postcss/postcss-bem-linter) and [stylelint](http://stylelint.io/). Minification is provided by [cssnano](http://cssnano.co/).\n\nAdditional plugins can be added via the configuration options.\n\n## Installation\n\n```\nnpm install suitcss-preprocessor\n```\n\n## Usage\n\n```\nsuitcss input.css output.css\n```\n\n## API\n\n### Command Line\n\nOptions are [documented below](#options)\n\n```\nUsage: suitcss [<input>] [<output>]\n\nOptions:\n\n  -h, --help                output usage information\n  -c, --config [path]       a custom PostCSS config file\n  -i, --import-root [path]  the root directory for imported css files\n  -s, --encapsulate         encapsulate component styles\n  -w, --watch               watch the input file and any imports for changes\n  -m, --minify              minify output with cssnano\n  -e, --throw-error         throw an error when any warnings are found\n  -L, --no-lint             disable stylelint and postcss-bem-linter\n  -v, --verbose             log verbose output for debugging\n  -V, --version             output the version number\n\nExamples:\n\n  # pass an input and output file:\n  $ suitcss input.css output.css\n\n  # configure the import root directory:\n  $ suitcss --import-root src/css input.css output.css\n\n  # watch the input file and imports for changes:\n  $ suitcss --watch input.css output.css\n\n  # configure postcss plugins with a config file:\n  $ suitcss --config config.js input.css output.css\n\n  # unix-style piping to stdin and stdout:\n  $ cat input.css | suitcss | grep background-color\n```\n\n### Node.js\n\nReturns a [PostCSS promise](http://api.postcss.org/LazyResult.html)\n\n```js\npreprocessor(css: String [, options: Object] [, filename: String]);\n```\n\n* `css`: CSS input (_required_)\n* `options`: Options to the preprocessor (see below) (_optional_)\n* `filename`: Filename of the input CSS file (_optional_)\n\n#### Example\n\n```js\nvar preprocessor = require(\'suitcss-preprocessor\');\nvar fs = require(\'fs\');\n\nvar filename = \'src/components/index.css\';\nvar css = fs.readFileSync(filename, \'utf8\');\n\npreprocessor(css, {\n  root: \'path/to/css\',\n  minify: true,\n}, filename).then(function(result) {\n  fs.writeFileSync(\'build/bundle.css\', result.css);\n});\n```\n\n### Options\n\n#### `root`\n\n* Type: `String`\n* Default: `process.cwd()`\n\nWhere to resolve imports from. Passed to [`postcss-import`](https://github.com/postcss/postcss-import/blob/master/README.md#root).\n\n#### `debug`\n\n* Type: `Function`\n* Default: identity (it does nothing)\n\nBefore preprocessing `debug` is invoked on the postcss `plugins` array.\nThis allows you to pass a [`postcss-debug`](https://www.npmjs.com/package/postcss-debug) instance.\n}\n```\n\nThis works the same with the CLI `-l` flag\n\n##### `minify`\n\n  debug.inspect();\n});\n```\n\nN.B. `debug` should always take one argument that is `plugins` and eventually return it:\n\n```javascript\nfunction debug(plugins) {\n  // do something with plugins here\n  return plugins;\n}\n```\n\n#### `encapsulate`\n\n_(experimental)_\n\n* Type: `Boolean`\n* Default: `false`\n\nResets CSS properties to their [initial values](https://developer.mozilla.org/en-US/docs/Web/CSS/initial_value)\nto effectively allow a component to opt out of CSS inheritance and be\nencapsulated from the rest of the application similar to [the Shadow DOM](https://www.w3.org/TR/shadow-dom/).\nThere are two types of CSS properties that affect components, inherited (e.g.\n`font-size,` `color`) and non-inherited (e.g. `margin`, `background`). This\noption works so that:\n\n* Root elements (e.g. `.Component`) have both inherited and non-inherited\n  properties reset to default values.\n* Descendants (e.g. `.Component-item`) only have non-inherited properties reset\n  as this allows properties set on the root element to be inherited by its\n  descendants.\n\nThis means that components are isolated from styles outside the component root\nelement but should an inheritable property such as `font-size` be applied on the\ncomponent root element it will be inherited by the component descendants as\nnormal. This prevents the need to redeclare properties on every descendant in a\ncomponent.\n\nThe same rules also apply to nested components.\n\n**Rationale**\n\nOne of the difficulties with CSS components is predictability. Unwanted styles\ncan be inherited from parent components and this can make it difficult to\nreuse components in different contexts.\n\nMethodologies such as SUIT and BEM exist to solve problems around the cascade\nand specificity but they cannot protect components from inheriting unwanted\nstyles. What would really help is to allow inheritance to be \'opt-in\' and let\ncomponent authors decide what properties are inherited. This creates a more\npredictable baseline for styling components and promoting easier\nreuse.\n\n* [Component Based Style Reuse](https://youtu.be/_70Yp8KPXH8?t=27m45s)\n* [React: CSS in JS](http://blog.vjeux.com/2014/javascript/react-css-in-js-nationjs.html)\n\n**Examples**\n\n* [CodePen encapsulate](http://codepen.io/simonsmith/pen/BLOyAX) - Demonstrates\n  how components are encapsulated from global and parent styles.\n* [CodePen encapsulate inheritance](http://codepen.io/simonsmith/pen/LRgxdp) -\n  Similar to above but shows how components can opt-in to inheritance.\n\n**What about `all: initial`?**\n\nThe `all: initial` declaration will reset both inherited and non-inherited\nproperties but this can be too forceful. For example `display` is reset to\n`inline` on block elements and as mentioned earlier, descendants of a component\nshould only have non-inherited properties reset to allow declarations to be\ninherited from the root element.\n\n> For example, if an author specifies `all: initial` on an element it will block\n  all inheritance and reset all properties, as if no rules appeared in the\n  author, user, or user-agent levels of the cascade.\n\nhttps://www.w3.org/TR/css3-cascade/#all-shorthand\n\nInstead a subset of properties are reset to allow more\ngranular control over what parts of a component use inheritance.\n\nTo achieve this the preprocessor uses\n[postcss-autoreset](https://github.com/maximkoretskiy/postcss-autoreset) with\nthe SUIT preset and a [custom set of CSS properties](lib/encapsulation.js) that\nare reset to their initial values. **Only selectors conforming** to the SUIT naming\nconventions are affected.\n\n**Caveats**\n\n##### Selectors must be present in the component CSS\n\nIf an element is present in the HTML but not styled in the component CSS\n(perhaps relying on utility classes) it will not be reset. In\nthis instance an empty ruleset can be added to ensure it is correctly reset:\n\n```html\n<div class="Component u-posRelative u-textCenter">\n  <div class="Component-item"></div>\n</div>\n```\n```css\n/**\n * Empty ruleset required.\n * Note the disabling of stylelint\n */\n\n/* stylelint-disable-next-line block-no-empty */\n.Component {}\n\n.Component-item {\n  color: red;\n}\n```\n\n##### Global styles can still override descendants\n\nBecause component descendants only have non-inheritable properties reset it can\nlead to specific global rules still applying:\n\n```css\n/* global.css */\nspan {\n  color: red;\n}\n\n/* component.css */\n.Component-text {\n  font-style: bold;\n}\n```\n```html\n<div class="Component">\n  <span class="Component-text">\n    <!-- this text is red -->\n  <span>\n</div>\n```\n\nThe solution to this is to minimise or avoid entirely the use of global styles\nwhich is the recommended approach in a SUIT CSS application.\n\n#### `lint`\n\n* Type: `Boolean`\n* Default: `true`\n\nEnsure code conforms to the [SUIT code style](https://github.com/suitcss/suit/blob/master/doc/STYLE.md)\nby using the [stylelint-config-suitcss](https://github.com/suitcss/stylelint-config-suitcss) package.\n\nStylelint [configuration\noptions](http://stylelint.io/?/docs/user-guide/configuration.md) can also be\noverridden but this requires the `stylelint-config-suitcss` to be installed\nlocally in your package.\n\n```js\n{\n  stylelint: {\n    extends: \'stylelint-config-suitcss\',\n    rules: {\n      indentation: [4, \'tab\'],\n    }\n  }\n}\n```\n\n#### `minify`\n\n* Type: `Boolean`\n* Default: `false`\n\nIf set to `true` then the output is minified by [`cssnano`](http://cssnano.co/).\n\n#### `postcss`\n\n* Type: `Object`\n* Default: `undefined`\n\nOptions that are passed directly to `postcss`, as per [the documentation](http://api.postcss.org/global.html#processOptions).\n\n```js\n{\n  postcss: {from: \'filename.css\'}\n}\n```\n\n##### `use`\n\n* Type: `Array`\n* Default: `undefined`\n\nA list of plugins that are passed to PostCSS. This can be used to add new plugins and/or reorder the defaults\n\n```js\n{\n  use: [\'postcss-at2x\', \'postcss-property-lookup\']\n}\n```\n\n#### `<plugin-name>`\n\n* Type: `Object`\n* Default: `undefined`\n\nProperty matching the name of a PostCSS plugin that has options for that plugin\n\n```js\n{\n  autoprefixer: {\n    browsers: [\'> 1%\', \'IE 7\'],\n    cascade: false\n  },\n  \'postcss-calc\': { preserve: true }\n}\n```\n\n### Plugin configuration\n\nCreating a configuration file allows options to be passed to the individual PostCSS plugins. It can be passed to the `suitcss` CLI via the `-c` flag and can be either JavaScript or JSON\n\n```js\nmodule.exports = {\n  root: \'path/to/css\',\n  autoprefixer: { browsers: [\'> 1%\', \'IE 7\'], cascade: false },\n  \'postcss-calc\': { preserve: true }\n}\n```\n\n```js\n{\n  "root": "path/to/css",\n  "autoprefixer": { "browsers": ["> 1%", "IE 7"], "cascade": false },\n  "postcss-calc": { "preserve": true }\n}\n```\n\nOptions are merged recursively with the defaults. For example, adding new plugins to the `use` array will result in them being merged alongside the existing ones.\n\n#### Adding additional plugins\n\nBy default the preprocessor uses all necessary plugins to build SUIT components. However additional plugins can be installed into a project and then added to the `use` array. They will be appended to the existing list of plugins.\n\n**Note**: This will not work with the preprocessor installed globally. Instead rely on the convenience of `npm run script`\n\n```js\nmodule.exports = {\n  use: [\n    \'postcss-property-lookup\'\n  ]\n};\n```\n\n```js\n{\n  "name": "my-pkg",\n  "version": "0.1.0",\n  "dependencies": {\n    "postcss-property-lookup": "^1.1.3",\n    "suitcss-preprocessor": "^0.5.0"\n  },\n  "scripts": {\n    "preprocess": "suitcss -c myconfig.js index.css build/built.css"\n  }\n}\n```\n\n```\nnpm run preprocess\n```\n\n#### Changing plugin order\n\nIf duplicate plugins are used they will be removed, but the new order will be respected. This is useful if you need to change the default order:\n\n```js\n// Default order\nvar defaults = [\n  \'postcss-custom-properties\',\n  \'postcss-calc\',\n  \'postcss-color-function\',\n  \'postcss-custom-media\',\n  \'postcss-apply\',\n];\n\n// config\nmodule.exports = {\n  use: [\n    \'postcss-at2x\',\n    \'postcss-calc\',\n  ]\n};\n\nvar result = [\n  \'postcss-custom-properties\',\n  \'postcss-color-function\',\n  \'postcss-custom-media\',\n  \'postcss-apply\',\n  \'postcss-at2x\',\n  \'postcss-calc\',\n];\n```\n\n**Note** Some core plugins such as `postcss-easy-import` and `autoprefixer`\ncannot be re-ordered. This is to ensure components are preprocessed correctly.\n\n#### Autoprefixer: vendor prefixes\n\nBy default the preprocessor uses the SUIT\n[browserslist](https://github.com/ai/browserslist) configuration:\n\n```\n> 1%, last 2 versions, safari > 6, ie > 9, ios > 6, android > 4.3, samsung > 3, chromeandroid > 50\n```\n\nThe preprocessor doesn\'t attempt to find any `browserslist` config file.\n\nInstead you can customise the browsers list\nvia [configuration file](#plugin-configuration).\n\n\n## Acknowledgements\n\nBased on [Myth](https://github.com/segmentio/myth) by Segment.io.\n', 'message': 'Update README\n', 'author_name': 'Simon Smith', 'lang': 'md'}