Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@airen #45

Closed
kafeigeiwo opened this issue Sep 22, 2016 · 1 comment
Closed

@airen #45

kafeigeiwo opened this issue Sep 22, 2016 · 1 comment

Comments

@kafeigeiwo
Copy link

使用了flexible库之后,还需要一个px就要去计算一下等于多少rem吗?虽然插件可以自动换算,但是怎样才可以根据设计稿的px来换算呢?也就是说比如设计稿是20px,在安装插件的情况下,我能直接输入20px来等插件自动换算吗?插件有自己的基准值,默认是40,所以每次使用的时候都是自己去随便估计一个px等插件自动换算,因为按照设计稿的px来直接换算的话,设觉比率不对!
我可能说的有点乱了!
反正就是我用了flexible库,并且也用插件自动换算,但是不能直接根据设计稿的px来换算成rem,换算出来的比率和视觉不一样!所以我是不是少了什么步骤???

@airen
Copy link
Contributor

airen commented Sep 22, 2016

请仔细阅读文章:http://www.w3cplus.com/mobile/lib-flexible-for-html5-layout.html

使用flexible不需要自己去计算。一种方法是使用编辑器的插件(目前只提供了Sublime text),根据自己平时设计图常用尺寸,修改基准值。如果你常使用的设计图是750px,那么设置为75。其他的尺寸类似。

更为自动化的是使用PostCSS插件:px2rem,或者使用postcss-adaptive。可以根据你自己的工作习惯,配置相关的参数即可。

@airen airen closed this as completed Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants