LESS ParseError: Unrecognised input

11,306

Solution 1

Looks like you just found an issue with the compiler.

Your code is perfectly fine and should work as expected. The culprit is the second rgba(132, 108, 172, 1). Delete that and it will work.

I played around a bit and it seems that this always happens when there is a comma separated list as parameter and any element of that list, that is not the first, contains a function call.

Workaround in Aureliano's answer.

Solution 2

I think that must be a problem with the enumeration. Try this:

@icon-text-shadow-default: 0.0625rem 0.0625rem rgba(132, 108, 172, 1), 0.125rem 0.125rem rgba(132, 108, 172, 1);
.icon-text-shadow (@icon-text-shadow: @icon-text-shadow-default) {
    box-shadow: @icon-text-shadow;
    -moz-box-shadow: @icon-text-shadow;
    -webkit-box-shadow: @icon-text-shadow; 
}
Share:
11,306
Adrian
Author by

Adrian

Updated on June 06, 2022

Comments

  • Adrian
    Adrian over 1 year

    I am getting an error when I compile this code here with WINLess:

    .icon-text-shadow (@icon-text-shadow: 0.0625rem 0.0625rem rgba(132, 108, 172, 1), 0.125rem 0.125rem rgba(132, 108, 172, 1);) {
        box-shadow: @icon-text-shadow;
        -moz-box-shadow: @icon-text-shadow;
        -webkit-box-shadow: @icon-text-shadow;
    }
    

    The error is:

    ParseError: Unrecognised input in PATH\file.less on line 34, column 126

    The column 126 is between the last ) and the first { I am rather new at this but I have searched everywhere and got no clue still what is wrong.

    Thank you for any suggestions..