我想用symfony2在assetic上切换我的项目但是当lessphp尝试编译我的LESS文件时,我有以下错误:
[error] expecting number: line:21
我的调查引导我走上这条路:
.note-gradient-variation(@note-names; @note-colors; @length);
我读过Lessphp不喜欢参数中的分号,但用逗号替换它不会改变任何东西。
我认为lessphp不会考虑关于参数的表格,有没有人知道这方面的一些事情?
我的完整代码
@note-colors : @note-10, @note-9, @note-8, @note-7, @note-6, @note-5, @note-4, @note-3, @note-2, @note-1, @note-0;
@note-names : note-10, note-9, note-8, note-7, note-6, note-5, note-4, note-3, note-2, note-1, note-0;
@length : length(@note-colors);
.border-gradient {
display: block;
height: 4px;
width: 100%;
.note-gradient-variation(@note-names; @note-colors; @length);
}
.note-gradient-variation(@names; @colors; @index) when (iscolor(extract(@colors, @index))) and (@index > 0) {
.note-gradient-variation(@names; @colors; (@index - 1)); // Decrement.
@name : extract(@names, @index);
@color : extract(@colors, @index);
&.@{name} {
background: color("@{color}"); /* Old browsers */
background: -moz-linear-gradient(left, darken(color("@{color}"), 10%) 0%, lighten(color("@{color}"), 20%) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,darken(color("@{color}"), 10%)), color-stop(100%,lighten(color("@{color}"), 20%))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, darken(color("@{color}"), 10%) 0%,lighten(color("@{color}"), 20%) 100%);
background: -o-linear-gradient(left, darken(color("@{color}"), 10%) 0%,lighten(color("@{color}"), 20%) 100%);
background: -ms-linear-gradient(left, darken(color("@{color}"), 10%) 0%,lighten(color("@{color}"), 20%) 100%);
background: linear-gradient(to right, darken(color("@{color}"), 10%) 0%,lighten(color("@{color}"), 20%) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=darken(color("@{color}"), 10%), endColorstr=lighten(color("@{color}"), 20%),GradientType=1 );
}
}
感谢您的帮助!