JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 301590
  • Score
    100M100P100Q167346F
  • License MIT

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

Package Exports

  • postcss-color-function

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-color-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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

Changelog

License