Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LESS ParseError: Unrecognised input

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..

like image 397
Adrian Avatar asked Oct 26 '25 03:10

Adrian


2 Answers

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.

like image 130
Lucas S. Avatar answered Oct 28 '25 18:10

Lucas S.


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; 
}
like image 39
Aureliano Far Suau Avatar answered Oct 28 '25 18:10

Aureliano Far Suau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!