Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Less compiler uses different floating point precision on Linux vs OSX

Whenever I compile less files to css on my computer (Ubuntu 13.10, AMD64) I get a very different floating point result than when my colleague compiles on his machine (Mac OSX 10.6). Which is all well and good. Floating point math etc, etc. The numbers are essentially the same. Blah blah.

But it makes diffing and committing the output really annoying. I end up with hundreds of these to ignore:

.col-lg-offset-10 {
  margin-left: 83.33333333%;
  margin-left: 83.33333333333334%;
}

What can I do to avoid this problem?

like image 221
aychedee Avatar asked Mar 14 '14 11:03

aychedee


1 Answers

Most likely you're using different Less versions. Less (since version 1.6.2) rounds output numbers to 8 digits after the decimal point. So the solution is to sync the Less tools you and your colleague use.

like image 140
seven-phases-max Avatar answered Oct 05 '22 06:10

seven-phases-max