.loop (@start, @end, @step, @className,@propertyName) when (@start < @end) {
.@{className}-@{start} {
@{propertyName}: @start * 1px;
}
.loop (@start + @step, @end, @step, @className, @propertyName);
}
.loop(12,48,2,fs,font-size);
我想要循环css公共类,但抛出错误,我不在错误的位置。 例如:
.fs-12{
font-size:12px;
}
.fs-13{
font-size:13px;
}
.mt-13{
margin-top:13px;
}
答案 0 :(得分:-1)
.loop (@start, @end, @step, @className,@propertyName) when (@start < @end) {
.@{className}-@{start} {
@{propertyName}: (@start * 1px);
}
.loop ((@start + @step), @end, @step, @className, @propertyName);
}
.loop(12,48,2, fs, font-size);