2

Currently, Web Essentials for Visual Studio 2013 supports SASS compilation. When when I compile a SASS variable with more than 5 decimal places, that number gets trimmed.

SASS

.example{ 
    line-height: 1.428571429; 
}

becomes

CSS

.example { 
    line-height: 1.42857; 
}

This is especially an issue with Bootstrap 3, as they use the above example for line height in buttons. The trimmed output number results in different button height across browsers.

Is there a way to change the SASS number precision through Web Essentials? I've opened up a feature request with them if it is not available.

Chris Barr
  • 29,851
  • 23
  • 95
  • 135
  • 1
    possible duplicate of [Sass and rounding down numbers. Can this be configured?](http://stackoverflow.com/questions/7672473/sass-and-rounding-down-numbers-can-this-be-configured) – cimmanon Jun 20 '14 at 14:22
  • Yes, I am aware this can be configured in plain SASS, but Web Essentials is a visual studio extension that makes SASS easily available to the user that installed it. However, if that solution will work, I would love to know where to put that line of code. – Chris Barr Jun 20 '14 at 14:24
  • 1
    UPDATE: This will be in the next release of Web Essentials. I was able to make a pull request to the Web Essentials source on GitHub, and it was accepted. – Chris Barr Jul 15 '14 at 18:24
  • @ChrisBarr I know this is old, but maybe you could make an answer out of the comment and possibly add any additional steps/information needed to make sure its working. – Michal Frystacky May 05 '16 at 17:09

2 Answers2

1

Inside your compilerconfig.json file in Visual Studio add the option:

"options": {"precision": 10}
tic
  • 2,484
  • 1
  • 21
  • 33
  • I'm marking this as the accepted answer now that this functionality is no longer present in Web Essentials. Web Compiler is the place where this needs to be configured. – Chris Barr Aug 16 '16 at 15:35
0

A PR was made to the Web Essentials project for this feature, so it should now be in there.

However, I no longer use Web Essentials for SASS compilation so I'm unsure if this is still the case.

Chris Barr
  • 29,851
  • 23
  • 95
  • 135