Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

postcss-color-hwb

postcss489kMIT3.0.0

PostCSS plugin to transform W3C CSS hwb() color to more compatible CSS (rgb() (or rgba()))

css, postcss, postcss-plugin, color, colour, rgb, hwb

readme

postcss-color-hwb Build Status

PostCSS plugin to transform W3C CSS hwb() color to more compatible CSS (rgb() (or rgba())).

Installation

$ npm install postcss-color-hwb

Usage

// dependencies
var fs = require("fs")
var postcss = require("postcss")
var colorHwb = require("postcss-color-hwb")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

// process css
var output = postcss()
  .use(colorHwb())
  .process(css)
  .css

Using this input.css:

body {
  color: hwb(90, 0%, 0%, 0.5);
}

you will get:

body {
  color: rgba(128, 255, 0, 0.5);
}

Checkout tests for more examples.


Contributing

Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.

$ git clone https://github.com/postcss/postcss-color-hwb.git
$ git checkout -b patch-1
$ npm install
$ npm test

Changelog

License

changelog

3.0.0 - 2017-05-15

  • Added: compatibility with postcss v6.x
  • Uodated dependencies

2.0.1 - 2016-11-28

2.0.0 - 2015-09-08

  • Added: compatibility with postcss v5.x
  • Removed: compatiblity with postcss v4.x

1.2.0 - 2015-08-13

  • Added: compatibility with postcss v4.1.x (#4)

1.1.0 - 2014-11-25

  • Enhanced exceptions

1.0.0 - 2014-10-04

Initial release from postcss-color