Less 更少的Mixin错误:在伪选择器之后

Less 更少的Mixin错误:在伪选择器之后,less,Less,我刚发现一个奇怪的情况。 似乎有一个错误:在伪选择器之后 请检查以下代码,并查看内联注释 .nav-prev a{ left:20px; &:before { top: 75%; .chevron-line; .rotate (); } // this mixin is causing an error and it wouldn't compile &:after { top

我刚发现一个奇怪的情况。 似乎有一个错误:在伪选择器之后

请检查以下代码,并查看内联注释

.nav-prev a{
    left:20px;
    &:before {
        top: 75%;
        .chevron-line;
        .rotate ();
    }
    // this mixin is causing an error and it wouldn't compile
    &:after {
        top: 25%;
        .chevron-line;
        .rotate (-45deg);
    }​
}

// // this is the fix applied for the previous error
// .nav-prev a:after {
//  top: 25%;
//  .chevron-line;
//  .rotate (-45deg);
// }​

.nav-next a{
    right:20px;
    &:before{
        top: 25%;
        .chevron-line;
        .rotate ();
    }
    // strangely this one works and compile correctly
    &:after{
        top: 75%;
        .chevron-line;
        .rotate (-45deg);
    }
}
注意:我使用LiveReload进行编译

问题

我的语法有什么问题? 或者它是一个更少的错误? 还是一个编译器错误


谢谢大家。

当我复制并粘贴您的问题代码时,出现了一个隐藏字符,导致我出错。上面给出的
.nav next a
的工作代码中不存在此字符,因此它很可能是罪魁祸首

.nav-prev a{
    left:20px;
    &:before {
        top: 75%;
        .chevron-line;
        .rotate ();
    }
    // this mixin is causing an error and it wouldn't compile
    &:after {
        top: 25%;
        .chevron-line;
        .rotate (-45deg);
    }​<--HIDDEN "DOT" CHARACTER SHOWING UP RIGHT HERE
}
.nav prev a{
左:20px;
&:之前{
最高:75%;
.雪佛龙线;
.轮换();
}
//此mixin导致错误,无法编译
&:之后{
最高:25%;
.雪佛龙线;
.旋转(-45度);

}​很好,谢谢你的链接。