高效使用scss编写样式表
sonder 小杯

使用scss的一些技巧学习

官网地址:https://www.sass.hk/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ====== 字体大小 ======
@for $i from 12 through 30 {
.f#{$i} {
font-size: #{$i}px;
}
}
// ====== 处理状态样式 ======
// 注意这里的key和value不要带引号
$map: (color_2: #ff9b00, color_3: #e60e0e);
@each $key,$value in $map {
.#{$key} {
color: $value;
}
}
  • 本文标题:高效使用scss编写样式表
  • 本文作者:sonder
  • 创建时间:2021-12-09 17:45:25
  • 本文链接:https://sonderss.github.io/2021/12/09/高效使用scss编写样式表/
 评论