Skip to content

Rework mixin to insert IE 8's opacity filter after any CSS 'opacity' declaration

License

Notifications You must be signed in to change notification settings

reworkcss/rework-mixin-opacity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rework-mixin-opacity

Build Status

A Rework mixin that inserts IE 8's proprietary opacity filter after any native CSS opacity declaration.

Installation

Install with npm:

npm install --save-dev rework-mixin-opacity

Use

As a Rework mixin:

var rework = require('rework');
var mixin = require('rework-plugin-mixin');
var opacity = require('rework-mixin-opacity');

var css = rework(source)
  .use(mixin({
    opacity: opacity
  }))
  .toString();

Reworking this CSS:

div {
  opacity: 0.5;
}

Yields:

div {
  opacity: 0.5;
  -ms-filter: "alpha(opacity=50)"
}

Testing

From the repo root:

npm test

About

Rework mixin to insert IE 8's opacity filter after any CSS 'opacity' declaration

Resources

License

Stars

Watchers

Forks

Packages

No packages published