scss循环

// 定义flex等分
@for $i from 0 through 12 {
	.f-#{$i} {
		flex: $i;
	}
}

//定义zindex层级
@for $i from 0 through 1000 {
	.zi-#{$i} {
		z-index: $i;
	}
	
}
// 定义字体(rpx)单位,10~100rpx  fs-10 ~ fs-100
@for $i from 10 through 100 {
	.fs-#{$i} {
		font-size: $i + rpx;
	}
}
// 定义内外边距,历遍0-500
@for $i from 0 through 500 {
	//m-all-30
	.m-all-#{$i} {
		margin: $i + rpx;
	}
	//p-all-30
	.p-all-#{$i} {
		padding: $i + rpx;
	}
	@each $short, $long in l left, t top, r right, b bottom {
		// 缩写版,结果如: ml-1 mr-10 mb-100 mt-135
		// 定义外边距
			.m#{$short}-#{$i} {
				margin-#{$long}: $i + rpx;
			}
		// 定义内边距,结果如:pl-30 pr-30 pb-30 pt-30
			.p#{$short}-#{$i} {
				padding-#{$long}: $i + rpx;
			}
		}
}
//全局宽高
@for $i from 0 through 750 {
	// w-0 ~ w-750
	.w-#{$i} {
		width: $i + rpx;
		max-width: $i + rpx;
		min-width: $i + rpx;
	}
	// h-0 ~ h-750
	.h-#{$i} {
		height: $i + rpx;
		max-height: $i + rpx;
		min-height: $i + rpx;
	}
	// lh-0 ~ lh-750
	.lh-#{$i} {
		line-height: $i + rpx;
	}
}

//全局圆角 行高 br-0 ~ br-100
@for $i from 0 through 100 {
	// w-0 ~ w-750
	.br-#{$i} {
		border-radius: $i + rpx;
	}
	// h-0 ~ h-750
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值