1 | # postcss-color-hwb [![Build Status](https://travis-ci.org/postcss/postcss-color-hwb.png)](https://travis-ci.org/postcss/postcss-color-hwb)
|
2 |
|
3 | > [PostCSS](https://github.com/postcss/postcss) plugin to transform [W3C CSS hwb() color](http://dev.w3.org/csswg/css-color/#the-hwb-notation) to more compatible CSS (rgb() (or rgba())).
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```bash
|
8 | $ npm install postcss-color-hwb
|
9 | ```
|
10 |
|
11 | ## Usage
|
12 |
|
13 | ```js
|
14 | // dependencies
|
15 | var fs = require("fs")
|
16 | var postcss = require("postcss")
|
17 | var colorHwb = require("postcss-color-hwb")
|
18 |
|
19 | // css to be processed
|
20 | var css = fs.readFileSync("input.css", "utf8")
|
21 |
|
22 | // process css
|
23 | var output = postcss()
|
24 | .use(colorHwb())
|
25 | .process(css)
|
26 | .css
|
27 | ```
|
28 |
|
29 | Using this `input.css`:
|
30 |
|
31 | ```css
|
32 | body {
|
33 | color: hwb(90, 0%, 0%, 0.5);
|
34 | }
|
35 |
|
36 | ```
|
37 |
|
38 | you will get:
|
39 |
|
40 | ```css
|
41 | body {
|
42 | color: rgba(128, 255, 0, 0.5);
|
43 | }
|
44 | ```
|
45 |
|
46 | Checkout [tests](test) for more examples.
|
47 |
|
48 | ---
|
49 |
|
50 | ## Contributing
|
51 |
|
52 | Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
|
53 |
|
54 | $ git clone https://github.com/postcss/postcss-color-hwb.git
|
55 | $ git checkout -b patch-1
|
56 | $ npm install
|
57 | $ npm test
|
58 |
|
59 | ## [Changelog](CHANGELOG.md)
|
60 |
|
61 | ## [License](LICENSE)
|