Wondering what’s next for npm?Check out our public roadmap! »

postcss-color-hcl

0.0.5 • Public • Published

postcss-color-hcl Build Status

PostCSS plugin to transform hcl() color to compatible CSS (#hex or rgba()).

Installation

$ npm install postcss-color-hcl

Usage

// dependencies
var fs = require("fs")
var postcss = require("postcss")
var colorHcl = require("postcss-color-hcl")
 
// css to be processed
var css = fs.readFileSync("input.css", "utf8")
 
// process css
var output = postcss()
  .use(colorHcl())
  .process(css)
  .css

Using this input.css:

body {
  color: hcl(2170%50%0.5);
  background: hcl(00%50%);
}
 

you will get:

body {
  color: rgba(221, 52, 80, 0.5);
  background: rgb(119, 119, 119);
}

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/devgru/postcss-color-hcl.git
$ git checkout -b patch-1
$ npm install
$ npm test

Changelog

License

Install

npm i postcss-color-hcl

DownloadsWeekly Downloads

2

Version

0.0.5

License

MIT

Last publish

Collaborators

  • avatar