Socket
Book a DemoInstallSign in
Socket

rework-rem-fallback

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rework-rem-fallback

Add pixel fallback to CSS rules using rem units

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

rework-rem-fallback Build Status

A Rework plugin to add pixel fallback for properties using rem units. This is a build time workaround for browsers that don't understand the rem unit. (cough IE<9)

Installation

npm install rework-rem-fallback

Use

As a Rework plugin:

// dependencies
var fs = require('fs');
var rework = require('rework');
var remFallback = require('rework-rem-fallback');

// css to be processed
var css = fs.readFileSync('build/build.css', 'utf8').toString();

// process css using rework-rem-fallback (default base 16px)
var out = rework(css).use(remFallback()).toString();

// process css using rework-rem-fallback (custom base 14px)
var out14 = rework(css).use(remFallback(14)).toString();

Output

.main-header {
  width: 5rem;
}

yields:

.main-header {
  width: 80px;
  width: 5rem;
}

License

MIT License

Keywords

css

FAQs

Package last updated on 06 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts