2013-02-28 66 views
3

我刚刚发现了一个奇怪的情况。 似乎有一个错误:伪选择后LESS Mixin Bug:Pseudo Selector后

请检查下面的代码,看到内嵌批注

.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编译。

问题

这有什么错我的语法? 还是缺少一个bug? 或者它是一个编译器错误?

谢谢你们。

回答

2

当我将你的问题代码复制并粘贴到this compiler时,有一个隐藏的字符显示出来,导致我的错误。这个字符是不存在在上面给出的.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 
} 
+0

太好了,谢谢你的联系。 – ifdion 2013-03-02 02:22:44