You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.以 SUI Mobile 为例,把sm.css里面涉及到动态更改html font-size的代码删除,通过查找可以知道其使用的是媒体查询的方式。
html {
font-size: 20px;
}
@media only screen and (min-width: 400px) {
html {
font-size: 21.33333333px !important;
}
}
@media only screen and (min-width: 414px) {
html {
font-size: 22.08px !important;
}
}
@media only screen and (min-width: 480px) {
html {
font-size: 25.6px !important;
}
}
如何使用
1.以 SUI Mobile 为例,把
sm.css
里面涉及到动态更改html font-size
的代码删除,通过查找可以知道其使用的是媒体查询的方式。2.按 lib-flexbile 方案更改html,最终如下:
3.然后从官方文档中可以知道 SUI Mobile 是基于 750px 的设计稿,结合 lib-flexible 方案设置了一个 scss 函数
4.最后,我们只需将 sm.css 里面涉及到的
classname: 2.1rem;
替换成classname:rem(2.1);
,这个交给 Sublime Text 就行。5.抛砖引玉,可以类似修改其它库。
Sublime Text 批量替换单位
Ctrl+H
选择正则匹配,匹配到带 rem 单位的正(负)整数、正(负)小数。以上正则可以匹配到下列几种情况
不匹配
The text was updated successfully, but these errors were encountered: