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

Fractional numbers such as ".01" get displayed as "0.01" #550

Closed
Lekensteyn opened this issue Oct 17, 2014 · 7 comments · Fixed by #624
Closed

Fractional numbers such as ".01" get displayed as "0.01" #550

Lekensteyn opened this issue Oct 17, 2014 · 7 comments · Fixed by #624

Comments

@Lekensteyn
Copy link

Lekensteyn commented Oct 17, 2014

A minor issue, but it differs from ruby-sass. Consider this test case:

#foo {
  d: .0001px;
  f: .01px;
  d: -.0001px;
  f: -.01px;
}

The expected result after passing through sassc is the the identity. I actually got this instead:

#foo {
  d: 0.0001px;
  f: 0.01px;
  d: -0.0001px;
  f: -0.01px;
}

According to CSS 3, 4.2. Numbers: the number type, a number is either an integer or zero or more integers followed by a dot, followed by one or more digits.

@mgol
Copy link

mgol commented Oct 17, 2014

Confirmed; in my app it's one of the remaining differences from the version compiled via Ruby Sass.

@jschulte
Copy link

I noticed this as well recently while working on Libsass 3.0, but decided it wasn't worth the effort to solve because there is no functional difference. Also, as you pointed out, "a number is either an integer or zero or more integers followed by a dot, followed by one or more digits". The way I read it, this isn't necessarily wrong, just slightly different from how it was done in Ruby Sass. It would be good to solve but shouldn't cause any issues for users.

@mgreter
Copy link
Contributor

mgreter commented Oct 18, 2014

This nuance is found here, if anyone cares to fix it: b860361#diff-cfe40fe6863b6bef68e57af57bca1155L324

@jschulte
Copy link

Ooh, there you go. I'll work on getting a pull request in to fix that. :)

@mgreter
Copy link
Contributor

mgreter commented Oct 18, 2014

PRs are always welcome :)

@Lekensteyn
Copy link
Author

Nice, I had no idea where to look for a possible fix. Thank you for picking it up!

@xzyfer
Copy link
Contributor

xzyfer commented Oct 29, 2014

Spec added sass/sass-spec#105.

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

Successfully merging a pull request may close this issue.

6 participants