Giter VIP home page Giter VIP logo

px2rem-gulp's People

Contributors

songsiqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

px2rem-gulp's Issues

提几个建议

  1. 生成的css 为何都是加 *.debug.css,是否考虑加个选项禁用自动加 .debug 的功能?
  2. 生成的CSS 格式是否考虑添加规范化格式的功能?如 expanded ,compact 等?
    谢谢作者的付出。

Rem version 不会生成dpr样式?

您好,up。很感谢创建了px2rem这个插件。
貌似Rem version 不会生成dpr样式,我查看了文档的配置项好像也没有设置的地方
求指教:pray:

.selector {
    width: 2rem;
    border: 1px solid #ddd;
}
/*  下面适配的语句不会生成
[data-dpr="1"] .selector {
    height: 32px;
    font-size: 14px;
}
[data-dpr="2"] .selector {
    height: 64px;
    font-size: 28px;
}
[data-dpr="3"] .selector {
    height: 96px;
    font-size: 42px;
}*/

我的gulpfile.js文件

var gulp = require('gulp')
var less = require('gulp-less')
var px2rem = require('gulp-px3rem')

gulp.task('less', function() {
    return gulp.src('./less/main.less')
                .pipe(less())
                .pipe(px2rem({
                    remUnit: 64
                }))
                .pipe(gulp.dest('./css'))
});

gulp.task('watch', function() {
    gulp.watch(['./less/**'], ['less'])
})

gulp.task('default', ['less', 'watch'])

文件生成:

.logo {
    margin: 0 auto;
    width: 176px;
    height: 64px;
    background: url('../images/logo.png') no-repeat;
    background-size: 100% auto;
}

-->

.logo {
  margin: 0 auto;
  width: 2.75rem;
  height: 1rem;
  background: url('../images/logo.png') no-repeat;
  background-size: 100% auto;
}

//[data-dpr="2"]?
//[data-dpr="3"]?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.