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

Precision #287

Closed
glebm opened this issue Feb 13, 2014 · 9 comments
Closed

Precision #287

glebm opened this issue Feb 13, 2014 · 9 comments

Comments

@glebm
Copy link
Contributor

glebm commented Feb 13, 2014

Does libsass support precision? It appears to be hardcoded at 5 https://github.com/hcatlin/libsass/blob/7936f599cb702c0753af508e6ecf56debd382c57/inspect.cpp#L313

@akhleung
Copy link

You're correct; it's currently hard-coded. It should be relatively easy to make it configurable.

@glebm
Copy link
Contributor Author

glebm commented Feb 18, 2014

I've raised an issue on Sass Ruby about raising the default, see: sass/sass#1122

@voxpelli
Copy link

I would make this a pretty high priority as it, as pointed out in the above mentioned issue, is kind of blocking big frameworks like Bootstrap from using libsass at the moment. Those projects are actively discouraging any SASS-compilation using a precision less than 10.

@thedeerchild
Copy link

Bumping this up, as it's actively causing issues for the Foundation framework.

@jacobsvante
Copy link

Why not just increase the precision value to 10? Would that raise any issues for any projects? Any performance decreases worth mentioning?

@voxpelli
Copy link

@jmagnusson There's an active discussion in sass/sass#1122 about the default, as mentioned by @glebm. I don't think libsass will want to diverge from the other Sass implementations in its default value so until Sass itself changes its default the only alternative for libsass is likely to mirror the configurability of precision that already exists in other implementations, as was initially suggested here.

@akhleung
Copy link

All right, I've pushed a fix for this. The context struct now has a precision field that you can set; I've also added a --precision option to SassC.

@mgreter
Copy link
Contributor

mgreter commented Mar 18, 2014

Thanks @akhleung! I already implemented it for the Perl Module and basic test is working correct!

@akhleung
Copy link

Was fixed, but now it's regressed. :-( Addressed in the newer ticket #364.

@Marabyte Marabyte mentioned this issue Nov 25, 2014
phillmv added a commit to appcanary/sassc-rails that referenced this issue Dec 8, 2016
Sass defaults to 5 digits of precision when performing calculations. This clashes with popular css frameworks like Bootstrap and Foundation. There is ongoing, unresolved discussion as to what defaults to uphold sass/sass#1122.

In the meantime, libsass has made this configurable, but defaults to Sass' values, i.e. sass/libsass#287 and sass/libsass#675

Common workarounds involve editing the precision value directly, i.e. https://github.com/twbs/bootstrap-sass/blame/master/README.md#L78 using the provided accessor http://sass-lang.com/documentation/Sass/Script/Value/Number.html#precision%3D-class_method

This commit simply makes sassc-rails pass along that default value from Sass proper.
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

6 participants