madskristensen / LessCompiler

A Visual Studio extension
Other
15 stars 8 forks source link

calc function not compiling correctly #17

Open CodeAbuser opened 5 years ago

CodeAbuser commented 5 years ago

Installed product versions

Description

When compiling LESS to CSS, the calc function is not working correctly.

Steps to recreate

  1. in a LESS file, add a line like this width: calc(50% - 20px);
  2. when you compile, you'll see the generated output is like this: width: calc(30%);
  3. it is supposed to retain the original calc but it looks like it's actually trying to subtract 20 from 50%

Current behavior

It's not supposed to modify what is in-between the parentheses of the calc function

Expected behavior

the text between the parentheses is supposed to be retained.

CodeAbuser commented 5 years ago

apparently this is a known issue with some compilers using a version of LESS lower than 1.4

https://stackoverflow.com/a/16324133