我有一组标题级别(1 到 6)。我正在使用 @for 循环,但我似乎无法弄清楚如何将它们分组为一个而不是单独的。
这是我正在使用的@for循环:
@for $i from 1 through 6 {
h#{$i},
.h#{$i} {
margin-bottom: $headings-margin-bottom;
line-height: $headings-line-height;
font-weight: $headings-font-weight;
font-family: $headings-font-family;
}
}
这就是我所期待的:
h1,
h2,
h3,
h4,
h5,
h6 {
/* styles */
}
以下是正在编译的内容:
h1 {
/* styles */
}
h2 {
/* styles */
}
h3 {
/* styles */
}
...