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

Division of numbers is broken in v4 #3615

Closed
MartijnCuppens opened this issue Apr 12, 2021 · 3 comments
Closed

Division of numbers is broken in v4 #3615

MartijnCuppens opened this issue Apr 12, 2021 · 3 comments

Comments

@MartijnCuppens
Copy link

In Less <v4

.selector {
  @number: 4;
  @divider: 2;
  value: @number / @divider;
}

compiles to

.selector {
  property: 2;
}

In v4, it compiles to

.selector {
  property: 4 / 2;
}
@matthew-dean
Copy link
Member

That is correct behavior. See: https://github.com/less/less.js/releases/tag/v4.0.0

@MartijnCuppens
Copy link
Author

Hmm, ok. But wrapping the calculation in parentheses doesn't always seem to work. For example in an if():

value: if(false, 1, (8 / 4)); // returns `value: 8 / 4`

@matthew-dean
Copy link
Member

@MartijnCuppens Interesting. File that as a separate bug?

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

2 participants