Skip to content

PostCSS plugin to transform W3C CSS color function to more compatible CSS

License

Notifications You must be signed in to change notification settings

postcss/postcss-color-function

Repository files navigation

postcss-color-function Build Status

PostCSS plugin to transform W3C CSS color function to more compatible CSS.

Installation

$ npm install postcss-color-function

Usage

// dependencies
var fs = require("fs")
var postcss = require("postcss")
var colorFunction = require("postcss-color-function")

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

// process css
var output = postcss()
  .use(colorFunction())
  .process(css)
  .css

Using this input.css:

body {
  background: color(red a(90%))
}

you will get:

body {
  background: rgba(255, 0, 0, 0.9)
}

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-function.git
$ git checkout -b patch-1
$ npm install
$ npm test

About

PostCSS plugin to transform W3C CSS color function to more compatible CSS

Resources

License

Stars

Watchers

Forks

Packages

No packages published