Skip to content

Commit b33d215

Browse files
committed
docs
1 parent c9e424c commit b33d215

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# spike-css-standards
1+
# Spike CSS Standards
22

33
[![npm](https://img.shields.io/npm/v/spike-css-standards.svg?style=flat-square)](https://npmjs.com/package/spike-css-standards)
44
[![tests](https://img.shields.io/travis/static-dev/spike-css-standards.svg?style=flat-square)](https://travis-ci.org/static-dev/spike-css-standards?branch=master)
@@ -9,9 +9,6 @@ standard plugin pack for postcss
99

1010
> **Note:** This project is in early development, and versioning is a little different. [Read this](http://markup.im/#q4_cRZ1Q) for more details.
1111
12-
### Why should you care?
13-
14-
Write about why this project is important.
1512

1613
### Installation
1714

@@ -21,7 +18,40 @@ Write about why this project is important.
2118
2219
### Usage
2320

24-
How to use this project.
21+
This is nothing more than a light wrapper around a postcss configuration object. Options are filtered into their appropriate plugins internally. All are optional.
22+
23+
```js
24+
const reshape = require('postcss')
25+
const htmlStandards = require('spike-css-standards')
26+
27+
postcss(cssStandards(/* options */))
28+
.process(someCss)
29+
.then((res) => { console.log(res.content) })
30+
```
31+
32+
By default, the css standard plugin pack includes:
33+
34+
- [sugarss](https://github.com/postcss/sugarss), provided as default parser
35+
- [postcss-import](https://github.com/postcss/postcss-import), default settings
36+
- [postcss-cssnext](http://cssnext.io/), default settings
37+
- [rucksack](https://simplaio.github.io/rucksack/), default settings
38+
- [cssnano](http://cssnano.co/), toggled with the `minify` option which is false by default
39+
40+
Any of these plugins can be customized by passing options described below.
41+
42+
### Options
43+
44+
| Name | Description | Default |
45+
| ---- | ----------- | ------- |
46+
| **root** | Root path used to resolve layouts and includes | |
47+
| **addDependencyTo** | Object with `addDependency` method that will get file paths for tracked deps from includes/layouts | |
48+
| **webpack** | Shortcut for webpack users to set the `root` and `addDependencyTo` options more easily. Pass webpack loader context. | |
49+
| **browsers** | Browser support provided to [autoprefixer](http://cssnext.io/usage/#browsers) | `> 1%, last 2 versions, Firefox ESR` |
50+
| **features** | Enable or disable [cssnext features](http://cssnext.io/usage/#features) | |
51+
| **warnForDuplicates** | Enable or disable [cssnext duplicate warnings](http://cssnext.io/usage/#warnforduplicates) | `true` |
52+
| **rucksack** | Options passed directly to [rucksack](http://simplaio.github.io/rucksack/docs/#options) | |
53+
| **parser** | custom css parser if desired. pass `false` to use the default css parser | `sugarss` |
54+
| **minify** | Minifies the css output by removing excess spaces and line breaks | `false` |
2555

2656
### License & Contributing
2757

0 commit comments

Comments
 (0)