/postcss-bgc-rgba-fallback

postcss plugin for background rgba polyfill

Primary LanguageJavaScriptMIT LicenseMIT

PostCSS Bgb Rgba Fallback

NPM Traivs CI Coverage NPM Downloads Greenkeeper badge

PostCSS plugin to polyfill background rgba for IE8

Detail about polyfill for background rgba in IE8

The origin artile Cross browser alpha transparent background CSS (rgba) is removed now. You can see this anwser from stackoverflow.

Installation

$ npm install postcss-bgc-rgba-fallback

Usage

// dependencies
var fs = require('fs')
var postcss = require('postcss')
var bgcRgbaFallback = require('postcss-bgc-rgba-fallback')

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

// process css
var output = postcss()
  .use(bgcRgbaFallback())
  .process(css)
  .css
.foo {
  background-color: rgba(255,102,0,0.3);
}
.foo {
  background-color: rgb(255,102,0);
  background-color: transparent\9;
  background-color: rgba(255,102,0,0.3);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4cFF6600, endColorstr=#4cFF6600);
  zoom: 1;
}
.foo:nth-child(n) {
  filter: none;
}

JavaScript Style Guide