rework-mixin-opacity

v0.2.0
A Rework opacity mixin that inserts IE 8's opacity filter
rework rework-mixin style stylesheet css preprocess preprocessor opacity

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
npm i rework-mixin-opacity

Metadata

  • MIT
  • Whatever
  • Unknown
  • released 6/19/2014

Downloads

Maintainers