All Projects → cytle → gulp-px2rpx

cytle / gulp-px2rpx

Licence: other
微信小程序 px转换为rpx

Programming Languages

javascript
184084 projects - #8 most used programming language

gulp-px2rpx

微信小程序 px转换为rpx

Installation

$ npm install --save-dev gulp-px2rpx

Usage

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'))
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].