# dfs-rem2rpx

> According to one stylesheet,make the rem to rpx

Latest version **1.2.5** (published 2019-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install dfs-rem2rpx
pnpm add dfs-rem2rpx
yarn add dfs-rem2rpx
bun add dfs-rem2rpx
```

Provides the command `rem2rpx`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2019-12-17 |
| First published | 2019-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | chenlang1996 |
| Keywords | css, scss, less, rem, rpx, remtorpx, rem2rpx |

## Links

- npm: https://www.npmjs.com/package/dfs-rem2rpx
- Repository: https://github.com/chenlang0311/dfs-rem2rpx
- Homepage: https://github.com/chenlang0311/dfs-rem2rpx#readme
- Issues: https://github.com/chenlang0311/dfs-rem2rpx/issues
- npm.io page: https://npm.io/package/dfs-rem2rpx

## Dependencies (7)

- [css](https://npm.io/package/css.md) ~2.2.0
- [less](https://npm.io/package/less.md) ^3.10.3
- [chalk](https://npm.io/package/chalk.md) ~0.5.1
- [extend](https://npm.io/package/extend.md) ~3.0.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.3
- [fs-extra](https://npm.io/package/fs-extra.md) ~0.16.3
- [commander](https://npm.io/package/commander.md) ~2.6.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.2.5 (latest) — 2019-12-17
- 1.2.4 — 2019-11-28
- 1.2.3 — 2019-11-26
- 1.2.2 — 2019-11-22
- 1.2.1 — 2019-11-21
- 1.2.0 — 2019-11-21
- 1.1.3 — 2019-11-21
- 1.1.2 — 2019-11-18
- 1.1.1 — 2019-11-18
- 1.1.0 — 2019-11-18
- 1.0.9 — 2019-11-15
- 1.0.8 — 2019-11-15
- 1.0.7 — 2019-11-15
- 1.0.6 — 2019-11-15
- 1.0.5 — 2019-11-15
- … 5 more at https://npm.io/package/dfs-rem2rpx/versions

## README

# dfs-rem2rpx

English | [简体中文](./README-cn.md)

According to one stylesheet,make the rem to rpx

Version: **1.2.5**
### Notice

    The version in 1.* is just support the file of css and less and scss

### install

    Run npm install dfs-rem2rpx -g
    if you want to compile less file you must install the less
    Run npm install less -g
    if you want to compile scss file you must install the node-sass
    Run npm install node-sass -g

### Usage css file

```
rem2rpx -o build a.css  or rem2rpx -o build a.less  or rem2rpx -o build a.scss

options:
-u, --rpxUnit :set `rpx` unit value (default: 100)'
-r, --rpxVersion :whether to generate rpx version stylesheet (default: true)
-p, --rpxPrecision :set rpx value precision (default: 6)', 6)
-o, --output [path]', 'the output file dirname'
```

### source

```
.a {
  width: 1rem;
  height: .1rem;
  line-height: 0.1rem;
  border: 1px solid red;
}
.b{
  width: 1rem;/*no*/
  padding: .2rem .4rem 0 0.4rem;
}
@keyframes mymove
{
from {top:0px;}
to {top:2rem;}
}
@media screen and (max-width: 300px) {
  body {
     width: 3rem;
     height: 1rem;/*no*/
  }
}
```

#### output build/a.rpx.css

```
.a {
  width: 100rpx;
  height: 10rpx;
  line-height: 10rpx;
  border: 1px solid red;
}

.b {
  width: 1rem;
  padding: 20rpx 40rpx 0 40rpx;
}

@keyframes mymove {
  from {
    top: 0px;
  }

  to {
    top: 200rpx;
  }
}

@media screen and (max-width: 300px) {
  body {
    width: 300rpx;
    height: 1rem;
  }
}
```

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