# postcss-px2rem

> Postcss version of px2rem

Latest version **0.3.0** (published 2016-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-px2rem
pnpm add postcss-px2rem
yarn add postcss-px2rem
bun add postcss-px2rem
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2016-05-09 |
| First published | 2015-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 265 |
| Author | songsiqi |
| Maintainers | songsiqi |
| Keywords | px2rem, postcss-plugin |

## Links

- npm: https://www.npmjs.com/package/postcss-px2rem
- Repository: git@github.com:songsiqi/px2rem-postcss
- Homepage: https://github.com/songsiqi/px2rem-postcss
- Issues: https://github.com/songsiqi/px2rem-postcss/issues
- npm.io page: https://npm.io/package/postcss-px2rem

## Dependencies (2)

- [px2rem](https://npm.io/package/px2rem.md) ~0.5.0
- [postcss](https://npm.io/package/postcss.md) ^5.0.0

## Recent versions

- 0.3.0 (latest) — 2016-05-09
- 0.2.0 — 2015-11-10
- 0.1.6 — 2015-09-05
- 0.1.5 — 2015-08-03
- 0.1.4 — 2015-07-03
- 0.1.3 — 2015-07-02
- 0.1.2 — 2015-06-30
- 0.1.1 — 2015-06-30
- 0.1.0 — 2015-06-30

## README

# postcss-px2rem

This is a [postcss](https://www.npmjs.com/package/postcss) plugin of [px2rem](https://www.npmjs.com/package/px2rem).

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]

[npm-image]: https://img.shields.io/npm/v/postcss-px2rem.svg?style=flat-square
[npm-url]: https://npmjs.org/package/postcss-px2rem
[travis-image]: https://img.shields.io/travis/songsiqi/px2rem-postcss.svg?style=flat-square
[travis-url]: https://travis-ci.org/songsiqi/px2rem-postcss
[downloads-image]: http://img.shields.io/npm/dm/postcss-px2rem.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/postcss-px2rem

## Usage

### Node

```
var postcss = require('postcss');
var px2rem = require('postcss-px2rem');
var originCssText = '...';
var newCssText = postcss().use(px2rem({remUnit: 64})).process(originCssText).css;
```

**Please see [px2rem](https://www.npmjs.com/package/px2rem) for more information about the features and usage of px2rem.**

### Gulp

```
npm install gulp-postcss
```

```
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var px2rem = require('postcss-px2rem');

gulp.task('default', function() {
  var processors = [px2rem({remUnit: 75})];
  return gulp.src('./src/*.css')
    .pipe(postcss(processors))
    .pipe(gulp.dest('./dest'));
});
```

### Webpack

```
npm install postcss-loader
```

```
var px2rem = require('postcss-px2rem');

module.exports = {
  module: {
    loaders: [
      {
        test: /\.css$/,
        loader: "style-loader!css-loader!postcss-loader"
      }
    ]
  },
  postcss: function() {
    return [px2rem({remUnit: 75})];
  }
}
```

### Grunt

```
npm install grunt-postcss
```

```
module.exports = function(grunt) {
  grunt.initConfig({
    postcss: {
      options: {
        processors: [
          px2rem({remUnit: 75})
        ]
      },
      dist: {
        src: 'src/*.css',
        dest: 'build'
      }
    }
  });
  grunt.loadNpmTasks('grunt-postcss');
  grunt.registerTask('default', ['postcss']);
}
```

## Change Log

### 0.3.0

* Deps: px2rem@~0.5.0
  * Support Animation keyframes (no `/*px*/` comment).

### 0.2.0

* Deps: postcss@^5.0.0

### 0.1.6

* Deps: px2rem@~0.4.0
  * The generated [data-dpr] rules follow the origin rule, no longer placed at the end of the whole style sheet.
  * Optimize 0px, do not generate 3 [data-dpr] rules.

### 0.1.5

* Do not extend current root node.

### 0.1.4

* Fix bug while working with webpack loader.

### 0.1.0

* First release.

## License

MIT

---
_Source: https://npm.io/package/postcss-px2rem · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
