postcss-color
PostCSS plugin to transform latest W3C CSS color module syntax to more compatible CSS.
This plugin can:
- transform
color()
torgb()
(orrgba()
). - transform RGBA hexadecimal notations (
#RRGGBBAA
or#RGBA
) torgba()
. - transform
hwb()
torgb()
(orrgba()
). - transform
rebeccapurple
torgb()
.
Installation
$ npm install postcss-color
Usage
// dependenciesvar fs = var postcss = var color = // css to be processedvar css = fs // process cssvar output = css
Using this input.css
:
you will get:
Checkout tests for more examples.
Options
color
(default: true
)
Allow you to disable transformation of color()
hexAlpha
(default: true
)
Allow you to disable transformation of #RRGGBBAA
or #RGBA
hwb
(default: true
)
Allow you to disable transformation of hwb()
rebeccapurple
(default: true
)
Allow you to disable transformation of rebeccapurple
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.git
$ git checkout -b patch-1
$ npm install
$ npm test