空间少循环 [英] Space in less loop
本文介绍了空间少循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个:
.loop(@index) when(@index =< @to) {
.page-@{index} {
nav{
ul{
li:nth-child(@{index}){
background:#fff;
}
}
}
}
.loop(@index + 1);
}
似乎有一个问题,因为我的css的输出是: / p>
It seems to have a problem, because the output of my css is :
ul li:nth-child( 2) {
background: #fff;
}
ul li:nth-child( 3) {
background: #fff;
}
它在伪选择器中创建一个空格,它不工作。
删除此空间的任何想法?
感谢
it creates a space in the pseudo selector and it doesn't work. Any ideas to remove this space ? Thanks
推荐答案
这是一个错误。解决方法是通过临时变量设置标识符,例如:
It's a bug. A workaround is to set the identifier via temporary variable, e.g.:
ul {
@li: ~"li:nth-child(@{index})";
@{li} {
background: #fff;
}
}
这篇关于空间少循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文