Giter Site home page Giter Site logo

flexible-px2rem's Introduction

vue2

index.html head 添加如下配置

name="apple-mobile-web-app-capable",content="yes"的meta标签

name="apple-touch-fullscreen",content="yes"的meta标签

<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>

说明:

taobao移动端适配方案,原理是根据不同的屏幕比例动态给html设置字体大小,设置属性dpr,以及 scale,根据不同屏幕尺寸动态创建不同的适口标签和缩放比例,达到适配效果

px2rem

自动将px转成rem,样式直接设置成px

npm install px2rem-loader --save-dev

build/utils.js中添加如下配置:

const px2remLoder = {

loader: 'px2rem-loader',

options: {

remUnit: 75

} }

generateLoaders中const loaders改为:

const loaders = options.usePostCSS ? [cssLoader, postcssLoader, px2remLoder] : [cssLoader, px2remLoder]

flexible-px2rem's People

Contributors

webpgy avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

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.