6

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

wizzfizz94
  • 1,288
  • 15
  • 20

1 Answers1

12

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;
}
Trung0246
  • 689
  • 1
  • 10
  • 21