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

Interpolation #{$x}00ms gobbles one 0? #2209

Closed
asottile opened this issue Dec 12, 2016 · 3 comments
Closed

Interpolation #{$x}00ms gobbles one 0? #2209

asottile opened this issue Dec 12, 2016 · 3 comments

Comments

@asottile
Copy link
Member

Bit by this after upgrading libsass (3.3.7 -> 3.4), though it appears they've simply made the behaviour there the same as sass. Unclear if this is a bug or if it is intended, it certainly seems strange:

Input scss

$x: 1;
a {
  b: #{$x}00ms;
}

Output css

a {
  b: 10ms;
}

Expected

a {
  b: 100ms;
}

Workaround

obviously this scss is slightly silly, this is a working version:

$x: 1;
a {
  b: #{$x}#{'00ms'};
}

or the actually sane solution:

$x: 1;
a {
  b: $x * 100ms;
}
@asottile
Copy link
Member Author

I imagine what is happening is it is parsing 00ms as 0ms which makes sense, the interpolation is probably a red herring.

Either way, I'm happy to close this as wontfix, just surprised me :)

@nex3 nex3 added bug Something isn't working and removed bug Something isn't working labels Dec 17, 2016
@nex3
Copy link
Contributor

nex3 commented Dec 17, 2016

This works as expected on master; the old behavior you're seeing is due to our old weird interpolation semantics.

@nex3 nex3 closed this as completed Dec 17, 2016
@asottile
Copy link
Member Author

for what it's worth, the linked article is interesting but doesn't seem to explain this specific case. That said, I'm fine to accept that this is just a weird case that is probably poorly written code that needs refactoring :) It could also be that it was depending on a bug in libsass and only when libsass was made compliant with ruby sass did it expose this strange situation.

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