1.公式
$baseWidthSize : 64px;
@function to($px) {
@return $px / $baseWidthSize * 1rem;
}
2.使用
width:to(24px);
height:to(24px);
$baseWidthSize : 64px;
@function to($px) {
@return $px / $baseWidthSize * 1rem;
}
width:to(24px);
height:to(24px);