Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

css

gruntjs

less

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

like image 302
wizzfizz94 Avatar asked Sep 04 '26 21:09

wizzfizz94


1 Answers

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;
}
like image 56
Trung0246 Avatar answered Sep 07 '26 07:09

Trung0246



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!