Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css calc( {percentage} -/+ {pixel amount} ) outputs as calc({percentage - pixel amount as percentage}) #2438

Closed
andrew-luhring opened this issue Feb 5, 2015 · 2 comments

Comments

@andrew-luhring
Copy link

example:

less:

a {

  left : calc(50% - 40px);
  width: 40px;
}

gets compiled as:

css

a {
  left: calc(50% - 40%);
  width: 40px;

}

/* or */

a {
  left: 10%;
  width: 40px;
}

What do?

@radium-v
Copy link
Contributor

radium-v commented Feb 5, 2015

Is Strict Math enabled when you build? http://lesscss.org/usage/#command-line-usage-strict-math

You could try escaping the value:

a {
  left: calc(~"50% - 40px");
  width: 40px;
}

@seven-phases-max
Copy link
Member

Yes: --strict-math.
Closing as duplicate of #974.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants