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

Incorrect evaluation of arithmetic inside interpolation #2203

Closed
xzyfer opened this issue Oct 8, 2016 · 4 comments
Closed

Incorrect evaluation of arithmetic inside interpolation #2203

xzyfer opened this issue Oct 8, 2016 · 4 comments

Comments

@xzyfer
Copy link
Contributor

xzyfer commented Oct 8, 2016

The behaviour of this changed LibSass 3.4. Interestingly in this case Ruby Sass' output is also incorrect. A bug has been filed with Ruby Sass also sass/sass#2160.

foo {
  a: #{5% / 2};
  b: #{+5% / 2};
  c: #{-5% / 2};
}

Expected output

foo {
  a: 5%/2;
  b: 5%/2;
  c: -5%/2;
}

LibSass 3.4 RC

foo {
  a: 2.5%;
  b: 2.5%;
  c: -2.5%;
}

Ruby Sass 3.4.21

foo {
  a: 5%/2;
  b: 5%/2;
  c: -2.5%;
}

Spec sass/sass-spec#940

@xzyfer xzyfer added this to the 3.4 milestone Oct 8, 2016
@xzyfer xzyfer self-assigned this Oct 8, 2016
@xzyfer xzyfer mentioned this issue Oct 8, 2016
6 tasks
@xzyfer
Copy link
Contributor Author

xzyfer commented Oct 8, 2016

The behaviour exhibited by LibSass here is different from Ruby Sass, but it is no more or less inconsistent. I don't believe this should block 3.4 unless it arises as an issue during RC.

We'll address this for good when sass/sass#2160 is resolved.

@xzyfer
Copy link
Contributor Author

xzyfer commented Oct 20, 2016

Rescoping this to post 3.4.

@xzyfer xzyfer modified the milestones: 3.4.1, 3.4 Oct 20, 2016
@xzyfer xzyfer modified the milestones: 3.4.1, 3.4.x Dec 28, 2016
@mgreter
Copy link
Contributor

mgreter commented Jan 11, 2018

@nex3 @chriseppstein is there a reason why ruby sass 3.5.5 still has this "unexpected" behavior? I believe this stems from static value parsing in ruby sass? Any plans if this will change in future versions? And if so, in what direction, leave it as is, or evaluate it as libsass currently does?

@nex3
Copy link
Contributor

nex3 commented Jan 12, 2018

It just hasn't been a high priority to fix—as far as I know, it hasn't come up in any real code. -5%/2 is the correct output, so that's what libsass should target.

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

No branches or pull requests

3 participants