https://github.com/cytle/gulp-px2rpx
微信小程序 px转换为rpx
https://github.com/cytle/gulp-px2rpx
Last synced: about 1 month ago
JSON representation
微信小程序 px转换为rpx
- Host: GitHub
- URL: https://github.com/cytle/gulp-px2rpx
- Owner: cytle
- Created: 2017-06-20T09:19:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-09T12:15:19.000Z (about 4 years ago)
- Last Synced: 2024-11-11T20:58:13.104Z (6 months ago)
- Language: JavaScript
- Size: 110 KB
- Stars: 24
- Watchers: 2
- Forks: 3
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gulp-px2rpx
微信小程序 px转换为rpx
## Installation
```shell
$ npm install --save-dev gulp-px2rpx
```## Usage
```js
const gulp = require('gulp');
const px2rpx = require('gulp-px2rpx');gulp.task('default', function () {
gulp.src('./css/*.css')
.pipe(px2rpx({
screenWidth: 750, // 设计稿屏幕, 默认750
wxappScreenWidth: 750, // 微信小程序屏幕, 默认750
remPrecision: 6 // 小数精度, 默认6
}))
.pipe(gulp.dest('./wxappCss'))
});
```