Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devgru/postcss-color-hcl
PostCSS plugin to transform hcl() color to compatible CSS (rgb() or rgba()).
https://github.com/devgru/postcss-color-hcl
Last synced: about 1 month ago
JSON representation
PostCSS plugin to transform hcl() color to compatible CSS (rgb() or rgba()).
- Host: GitHub
- URL: https://github.com/devgru/postcss-color-hcl
- Owner: devgru
- License: mit
- Created: 2015-05-25T00:07:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-06T16:50:19.000Z (almost 9 years ago)
- Last Synced: 2024-09-28T09:23:29.832Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 10
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-color-hcl [![Build Status](https://travis-ci.org/devgru/postcss-color-hcl.png)](https://travis-ci.org/postcss/postcss-color-hcl)
> [PostCSS](https://github.com/postcss/postcss) plugin to transform [hcl() color](http://hclwizard.org/hcl-color-scheme/) to compatible CSS (#hex or rgba()).
## Installation
```bash
$ npm install postcss-color-hcl
```## Usage
```js
// 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`:
```css
body {
color: hcl(21, 70%, 50%, 0.5);
background: hcl(0, 0%, 50%);
}```
you will get:
```css
body {
color: rgba(221, 52, 80, 0.5);
background: rgb(119, 119, 119);
}
```Checkout [tests](test) 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](CHANGELOG.md)
## [License](LICENSE)