我想将 px 打印到 % 怎么可能?我正在使用循环 px 创建边距类工作正常,但是当我设置 % 而不是像 margin-#{$side}: #{$space}%; 任何解决方案。我想要输出百分比。提前感谢
$spaceamounts: (5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 75, 100);
$top: (top);
@each $space in $spaceamounts {
@each $side in $top {
.margin-#{$side}-#{$space} {
margin-#{$side}: #{$space}px;
}
}
}