postcss-color-hwb
PostCSS plugin to transform W3C CSS hwb() color to more compatible CSS (rgb() (or rgba()))
Last updated 5 years ago by moox .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install postcss-color-hwb 
SYNC missed versions from official npm registry.

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

Current Tags

  • 3.0.0                                ...           latest (3 years ago)

6 Versions

  • 3.0.0                                ...           3 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           5 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
Downloads
Today 4
This Week 2,382
This Month 12,620
Last Day 744
Last Week 4,118
Last Month 20,502
Dependencies (4)
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |