0

我想用 symfony2 将我的项目切换到资产,但是当 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 );
    }
}

谢谢您的帮助!

4

0 回答 0