我遇到了使用“&”级联选择器获取LessCSS以处理具有一系列嵌套规则的文件的实际问题。LessCSS:连接类中的嵌套函数 - 已解决
例如,下面的工作没有错误:如果我改变颜色为(任何形式的 - 预定义或混入)函数
.grey-table {
background: #EDEDED;
tr {
th {
background: #DEDEDE;
}
td {
color: #888;
}
&:nth-child(odd) {
td {
background-color: #F9FCFF;
}
}
&:nth-child(even) {
td {
background-color: #EDF5FF;
}
}
&:hover {
td {
background-color: #DFEAF9;
}
};
}
}
但是,我得到的错误
“第12行语法错误 - 未定义“
.grey-table {
background: desaturate(#EDEDED, 100%);
tr {
th {
background: desaturate(#DEDEDE, 100%);
}
td {
color: desaturate(#888, 100%);
}
&:nth-child(odd) {
td {
background-color: desaturate(#F9FCFF, 100%); <------ Line 12
}
}
&:nth-child(even) {
td {
background-color: desaturate(#EDF5FF, 100%);
}
}
&:hover {
td {
background-color: desaturate(#DFEAF9, 100%);
}
};
}
}
我无法找到任何这参考材料,但我敢肯定,我不能成为唯一吗?
非常感谢。
我试过这个,并收到相同的错误。 我也尝试将颜色定义为变量,但似乎没有帮助。 – JamesBirkett 2013-02-27 12:40:59
我不知道,现在以很少的方式在很多方面尝试了你的确切代码......它似乎对我有效。我很抱歉...我无法重现错误。 – 2013-02-27 12:57:06