Less doesn't support new math functions (e.g. min, max)
See original GitHub issueborder-width: max(.01rem, 1px);
This code will break compile process.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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)";
Should be working as of Less 4