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

matthew-dean picture matthew-dean  路  6Comments

vecerek picture vecerek  路  5Comments

BrianMulhall picture BrianMulhall  路  4Comments

seven-phases-max picture seven-phases-max  路  6Comments

joe223 picture joe223  路  4Comments