question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Less doesn't support new math functions (e.g. min, max)

See original GitHub issue
border-width: max(.01rem, 1px);

This code will break compile process.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
kbavcommented, Feb 18, 2020

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)";

3reactions
matthew-deancommented, Jan 10, 2021

Should be working as of Less 4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use native CSS min/max functions with LESS [duplicate]
I want to use the min() CSS function with a stylesheet written in LESS. However, LESS has its own min and max functions...
Read more >
Functions | Less.js
Less extends CSS with dynamic behavior such as variables, mixins, operations and functions. Less runs on both the server-side (with Node.js and Rhino)...
Read more >
CSS math functions min(), max() and clamp() - CanIUse
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >
min(), max(), and clamp(): three logical CSS functions to use ...
Min, max, and clamp provide some powerful CSS capabilities that enable more responsive styling with fewer liens of code.
Read more >
min() - CSS: Cascading Style Sheets - MDN Web Docs
The min() function takes one or more comma-separated expressions as its parameter, with the smallest (most negative) expression value result ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found