Skip to content

px-to-rem是一个将css的px转换为rem是插件,基于JavaScript编写。用于单位转换做移动端适配

Notifications You must be signed in to change notification settings

webharry/px-to-rem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Information

Package gulp-px-to-rem

Description px-to-rem plugin for gulp

Node Version >= 0.10

px-to-rem Version >= 1.x

Gulp Version 3.x

Installation

npm install --save-dev gulp-px-to-rem

Basic Usage

var gulp = require('gulp');
var px2rem = require('gulp-px-to-rem');

gulp.task('default', function(){
    gulp.src('./*.css')
        .pipe(px2rem({accuracy:2}))
        .pipe(gulp.dest('./dist'));
});

Options

The options you can use can be found here. Below is a list of valid options as of the time of writing:

  • rootPX: base fant size(defalut:75)
  • accuracy: Keep the number of decimal digits(defalut:2)

The options is not necessary, it's handled automatically by this plugin.

About

px-to-rem是一个将css的px转换为rem是插件,基于JavaScript编写。用于单位转换做移动端适配

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published