postcss-color-rgba-fallback

WebJar for postcss-color-rgba-fallback

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

postcss-color-rgba-fallback
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

postcss-color-rgba-fallback
WebJar for postcss-color-rgba-fallback
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/postcss/postcss-color-rgba-fallback

Download postcss-color-rgba-fallback

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/postcss-color-rgba-fallback/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>postcss-color-rgba-fallback</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/postcss-color-rgba-fallback/
implementation 'org.webjars.npm:postcss-color-rgba-fallback:3.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/postcss-color-rgba-fallback/
implementation ("org.webjars.npm:postcss-color-rgba-fallback:3.0.0")
'org.webjars.npm:postcss-color-rgba-fallback:jar:3.0.0'
<dependency org="org.webjars.npm" name="postcss-color-rgba-fallback" rev="3.0.0">
  <artifact name="postcss-color-rgba-fallback" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='postcss-color-rgba-fallback', version='3.0.0')
)
libraryDependencies += "org.webjars.npm" % "postcss-color-rgba-fallback" % "3.0.0"
[org.webjars.npm/postcss-color-rgba-fallback "3.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : postcss jar [6.0.6,7)
org.webjars.npm : postcss-value-parser jar [3.3.0,4)
org.webjars.npm : rgb-hex jar [2.1.0,3)

Project Modules

There are no modules declared in this project.

postcss-color-rgba-fallback Travis Build Status

PostCSS plugin to transform rgba() to hexadecimal.

Installation

$ npm install postcss-color-rgba-fallback

Usage

// dependencies
var fs = require("fs")
var postcss = require("postcss")
var colorRgbaFallback = require("postcss-color-rgba-fallback")

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

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

Using this input.css:

body {
  background: rgba(153, 221, 153, 0.8);
  border: solid 1px rgba(100,102,103,.3);
}

you will get:

body {
  background: #99DD99;
  background: rgba(153, 221, 153, 0.8);
  border: solid 1px #646667;
  border: solid 1px rgba(100,102,103,.3);
}

Node.js options

postcss-color-rgba-fallback accepts options

properties

default: [ "background-color", "background", "color", "border", "border-color", "outline", "outline-color ]

Allows you to specify your whitelist of properties. This option enables adding a fallback for one or a properties list

oldie

default: false

Set to true to enable the option and to get fallback for ie8

backgroundColor

default: null

Allows you to specify a background color to use as a base alpha matte.

Instead of cutting off the alpha channel it will blend the foreground and background.

Expects an array of rgb values:

  "backgroundColor": [255, 1, 1]

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

Changelog

License

org.webjars.npm

PostCSS

PostCSS and plugins based on it

Versions

Version
3.0.0