Error when assetic with lessphp try to compile a LESS file

81 views Asked by At

I want to switch my project on assetic with symfony2 but when lessphp try to compile my LESS file, I have the following error:

[error] expecting number: line:21

My investigation leads me to this line:

.note-gradient-variation(@note-names; @note-colors; @length);

I've read that Lessphp does not like the semicolon in the arguments, but replace this with a comma does not change anything.

I think lessphp not considers tables on arguments, does anyone know a few things about that?

My complete code below

@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 );
    }
}

Thanks for the help!

0

There are 0 answers