// 定义字体大小
@for $i from 12 through 40 {
@if $i % 2 == 0 or $i % 5 == 0 {
.z-font-#{$i} {
font-size: $i + px;
}
}
}
// 定义内外边距,历遍1-40
@for $i from 0 through 40 {
@if $i % 2 == 0 or $i % 5 == 0 {
.z-m-#{$i} {
margin: $i + px!important;
}
.z-p-#{$i} {
padding: $i + px!important;
}
@each $short, $long in l left, t top, r right, b bottom, x (left, right), y (top, bottom) {
@if $short == x or $short == y {
.z-m#{$short} {
@each $direction in $long {
margin-#{$direction}: $i + px!important;
}
}
} @else {
.z-m#{$short}-#{$i} {
margin-#{$long}: $i + px!important;
}
}
}
}
}
scss 项目基础构建
最新推荐文章于 2023-12-08 10:29:43 发布