Less.js: calc -- not working correctly.

Created on 10 Mar 2016  ·  3Comments  ·  Source: less/less.js

[less.min.js - v2.5.3]
I tried to use 'calc' such as "width:calc(100% - 35px);" and it would calculate the 35px as a percent i.e. 100% - 35% (page displayed width:65%).

I am still new to LESS and not sure if this is a bug or maybe I am not using it correctly?

Most helpful comment

You should use:

width: ~"calc(100% - 35px)";

You can try it here.

All 3 comments

You should use:

width: ~"calc(100% - 35px)";

You can try it here.

See --strict-math and examples of escaping syntax (for the default --strict-math=off) there.

Closing as expected behaviour.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rejas picture rejas  ·  6Comments

renoth picture renoth  ·  6Comments

awebdev picture awebdev  ·  4Comments

seven-phases-max picture seven-phases-max  ·  6Comments

briandipalma picture briandipalma  ·  6Comments