我有以下for循环:
@for $i from 1 through $columns {
.tile#{$i}.noMargin {
margin:0;
}
}
输出为:
.threeColForm .tile1.noMargin {
margin: 0; }
.threeColForm .tile2.noMargin {
margin: 0; }
.threeColForm .tile3.noMargin {
margin: 0; }
.threeColForm .tile4.noMargin {
margin: 0; }
.threeColForm .tile5.noMargin {
margin: 0; }
.threeColForm .tile6.noMargin {
margin: 0; }
.threeColForm .tile7.noMargin {
margin: 0; }
.threeColForm .tile8.noMargin {
margin: 0; }
.threeColForm .tile9.noMargin {
margin: 0; }
.threeColForm .tile10.noMargin {
margin: 0; }
.threeColForm .tile11.noMargin {
margin: 0; }
.threeColForm .tile12.noMargin {
margin: 0; }
有没有办法写这个所以它会像这样输出:
.threeColForm .tile1.noMargin,
.threeColForm .tile2.noMargin,
.threeColForm .tile3.noMargin,
.threeColForm .tile4.noMargin,
.threeColForm .tile5.noMargin,
.threeColForm .tile6.noMargin,
.threeColForm .tile7.noMargin,
.threeColForm .tile8.noMargin,
.threeColForm .tile9.noMargin,
.threeColForm .tile10.noMargin,
.threeColForm .tile11.noMargin,
.threeColForm .tile12.noMargin {
margin: 0;
}
任何帮助表示赞赏。谢谢
我的CSS(仅供参考):
.threeColForm {
//cols, gutter
@include grid(12, 1);
}