UNPKG

1.25 kBMarkdownView Raw
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
15var fs = require("fs")
16var postcss = require("postcss")
17var colorHwb = require("postcss-color-hwb")
18
19// css to be processed
20var css = fs.readFileSync("input.css", "utf8")
21
22// process css
23var output = postcss()
24 .use(colorHwb())
25 .process(css)
26 .css
27```
28
29Using this `input.css`:
30
31```css
32body {
33 color: hwb(90, 0%, 0%, 0.5);
34}
35
36```
37
38you will get:
39
40```css
41body {
42 color: rgba(128, 255, 0, 0.5);
43}
44```
45
46Checkout [tests](test) for more examples.
47
48---
49
50## Contributing
51
52Work 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)