PostCSS plugin to transform RGBA hexadecimal notations (#RRGGBBAA or #RGBA) to more compatible CSS (rgba())
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

postcss-color-hex-alpha CSS Standard Status Build Status

PostCSS plugin to transform W3C RGBA hexadecimal notations (#RRGGBBAA or #RGBA) to more compatible CSS (rgba()).


$ npm install postcss-color-hex-alpha


// dependencies
var fs = require("fs")
var postcss = require("postcss")
var colorHexAlpha = require("postcss-color-hex-alpha")

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

// process css
var output = postcss()

Using this input.css:

body {
  background: #9d9c

you will get:

body {
  background: rgba(153, 221, 153, 0.8)

Checkout tests for more examples.


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

$ git clone
$ git checkout -b patch-1
$ npm install
$ npm test