border-width: max(.01rem, 1px);
This code will break compile process.
Note: This is likely also true for the related clamp()
function.
For anyone coming across this needing a workaround, you can always use LESS' string escaping capabilities to pass along a plain string to the CSS, eg.
border-width: ~"max(.01rem, 1px)";
@kbav Thanks锛宼hat's really helpful!
If you need to use Less variables, e.g. max(@my-var, 1px)
, you can do
@my-var: .01rem;
--my-var: @my-var;
border-width: ~"max(var(--my-var), 1px)";
Should be working as of Less 4
Most helpful comment
Note: This is likely also true for the related
clamp()
function.A workaround
For anyone coming across this needing a workaround, you can always use LESS' string escaping capabilities to pass along a plain string to the CSS, eg.
border-width: ~"max(.01rem, 1px)";