2.0.5 • Published 3 years ago

node-px2rem v2.0.5

Weekly downloads
190
License
MIT
Repository
github
Last release
3 years ago

Pixel to rem NPM version Build Status Dependency Status Coverage Status

Version: 2.0.5

Installation

Run npm install node-px2rem

Usage

'use strict';

const fs = require('fs');
const px2rem = require('node-px2rem');
const css = fs.readFileSync('main.css', 'utf8');
const processedCSS = px2rem.process(css, {
  rootValue: 16
});

fs.writeFile('main-rem.css', processedCSS, (err) => {
  if (err) {
    throw err;
  }

  console.log('Done.');
});

API

Options

Type: Object | Null Default:

{
  rootValue: 16,
  unitPrecision: 5,
  propertyBlackList: [],
  propertyWhiteList: [],
  replace: false,
  mediaQuery: false,
  minPx: 1
}
  • rootValue (Number) The root element font size.
  • unitPrecision (Number) The decimal numbers to allow the REM units to grow to.
  • propertyBlackList (Array) The properties that can't change from px to rem.
  • propertyWhiteList (Array) The properties that can change from px to rem
  • replace (Boolean) Replaces rules containing rems instead of adding fallbacks.
  • mediaQuery (Boolean) Allow px to be converted in media queries.
  • minPx (Number) If minimum px greater than or equal can change from px to rem.

License

MIT © 2021 Gergely Kovács (gg.kovacs@gmail.com)

2.0.5

3 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

7 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago