🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

clever-rem

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clever-rem

rem响应,和设计稿尺寸一样

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

聪明的响应式(rem)

1.适合移动端响应

2.配合stylus使用更佳

3.默认设计稿宽度750

4.主要使用宽度去适配,设备尺寸和比例太多,宽高都去适配会导致页面变形

import {Rem} from 'clever-rem';
Rem(750);

// import Rem from 'clever-rem';
// Rem(750);

// 两种方式都可以使用,建议在根组件中使用 750是设计稿宽度

styl文件

$REM = 1000;
rem($px) {
  $px / $REM rem;
}
.example {
    width: rem(750); // 相当于宽度占满,注意样式要初始化,去掉默认margin padding
}

Keywords

rem

FAQs

Package last updated on 01 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts