PostCSS plugin to add opacity filter for IE8 and legacy browsers
JavaScript
Latest commit 888ffa5 Jun 28, 2016 @iamvdo 4.0.0
Permalink
Failed to load latest commit information.
test
.gitignore
.npmignore
.travis.yml Initial release Feb 19, 2015
ChangeLog.md 4.0.0 Jun 28, 2016
LICENSE Initial release Feb 19, 2015
README.md
gulpfile.js fix: tests fixed, and readme updated Jun 24, 2016
index.js fix: tests fixed, and readme updated Jun 24, 2016
package.json

README.md

PostCSS Opacity Build Status

PostCSS plugin that adds support for legacy browser opacity alternatives.

Example

postcss([
    require('postcss-opacity')
])
/* Input example */
.foo {
  opacity: .5;
}
/* Output example */
.foo {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
  opacity: .5;
}

Legacy

Support for IE 5-7, Safari 1.X, Netscape

postcss([
    require('postcss-opacity')({
        legacy: true    
    })
])
/* Input example */
.foo {
  opacity: .5;
}
/* Output example */
.foo {
  /* IE 8 */
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";

  /* IE 5-7 */
  filter: alpha(opacity=50);

  /* Netscape */
  -moz-opacity: .5;

  /* Safari 1.x */
  -khtml-opacity: .5;

  /* Modern browsers */
  opacity: .5;
}

See PostCSS docs for examples for your environment.