新建下面snippet
torem
在scss中使用定义
// 移动端定义px自动转rem函数
// 设计图宽 比例
// 640px 1.875
// 740px 1.66
// 750px 1.6
@function torem(px) {
@returnpx * 1.6 / 100px * 1rem;
}
使用方法
.header { width: 100%; height: torem(10px); }
新建下面snippet
torem
在scss中使用定义
// 移动端定义px自动转rem函数
// 设计图宽 比例
// 640px 1.875
// 740px 1.66
// 750px 1.6
@function torem(px) {
@returnpx * 1.6 / 100px * 1rem;
}
使用方法
.header { width: 100%; height: torem(10px); }