'Less.js: error evaluating function `min`: incompatible types [duplicate]

I have the following styling in my _main.less file

#mapid {
  width: 100%;
  min-height: min(65vh, 500px);
  max-height: 500px;
}

But the Less compiler complains (using grunt)

>> File "public/less/_main.less" changed.
Running "less:development" (less) task
>> ./public/less/_main.less: [L86:C14] error evaluating function `min`: incompatible types
Warning: Error compiling ./public/less/_main.less Use --force to continue.

Aborted due to warnings.

But this works fine in CSS (see docs).



Solution 1:[1]

Refer to Disable LESS-CSS Overwriting calc(), you can use escape string in LessCSS:

#mapid {
    width: 100%;
    min-height: ~"min(65vh, 500px)";
    max-height: 500px;
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Trung0246