Use native CSS min/max functions with LESS

Viewed 331

I want to use the min() CSS function with a stylesheet written in LESS. However, LESS has its own min and max functions that precompute values (making it impossible to mix-and-match units). How do I get it so the output CSS has the min/max functions as I wrote them?

Here is the style in the LESS file, which should also be the expected output.

canvas {
    background: white;
    width: min(95vh, 95vw);
    height: min(95vh, 95vw);
}

I am using lessc 3.13.1, which produces the following error:

ArgumentError: error evaluating function `min`: incompatible types in <snipped> on line 49, column 12:
48     background: white;
49     width: min(95vh, 95vw);
50     height: min(95vh, 95vw);
1 Answers
Related