mrcrowl / vscode-easy-less

Easy LESS extension for Visual Studio Code
MIT License
67 stars 23 forks source link

Possible issue with calculations inside unit()/percentage() #83

Closed krsdcbl closed 3 years ago

krsdcbl commented 3 years ago

Hello,

I am recently encountering the errors Error evaluating function unit: the first argument to unit must be a number. Have you forgotten parenthesis? and Error evaluating function percentage: argument must be a number when compiling my LESS files with this extension.

Experimenting around a bit, this seems to be due to instances when I use a calculation directly in the function without wrapping it in parentheses, like: prop: unit( 1 / 2, rem); instead of prop: unit( ( 1 / 2 ), rem);.

Yet this is the only compiler I'm using throwing these errors, so far tested with @zeit/next-less as well as official http://lesscss.org/less-preview/, and they will take code without the extra parentheses just fine. Might this be a case of other compilers handling the spec too loosely, or is this a possible bug?

Thanks & all best

mrcrowl commented 3 years ago

Have you experimented with the math options?

Search for math here https://marketplace.visualstudio.com/items?itemName=mrcrowl.easy-less

On Thu, 6 May 2021 at 9:21 PM, Kristof Tarizsnyas @.***> wrote:

Hello,

I am recently encountering the errors Error evaluating function unit: the first argument to unit must be a number. Have you forgotten parenthesis? and Error evaluating function percentage: argument must be a number when compiling my LESS files with this extension.

Experimenting around a bit, this seems to be due to instances when I use a calculation directly in the function without wrapping it in parentheses, like: prop: unit( 1 / 2, rem); instead of prop: unit( ( 1 / 2 ), rem);.

Yet this is the only compiler I'm using throwing these errors, so far tested with @zeit/next-less as well as official http://lesscss.org/less-preview/, and they will take code without the extra parentheses just fine. Might this be a case of other compilers handling the spec too loosely, or is this a possible bug?

Thanks & all best

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mrcrowl/vscode-easy-less/issues/83, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANWRIF57GIBOGRHR3KKKGLTMJNR7ANCNFSM44GUZ7GQ .

krsdcbl commented 3 years ago

Thanks very much for the pointer, I must have completely overlooked that part of the readme! i guess it's just default setting that changed then