Skip to content

Commit

Permalink
Engine init looks up current Sass number precision
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
phillmv authored Dec 8, 2016
1 parent 63acddc commit cc1ede7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sassc/rails/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def call(input)
syntax: self.class.syntax,
load_paths: input[:environment].paths,
importer: SassC::Rails::Importer,
precision: ::Sass::Script::Value::Number.precision,
sprockets: {
context: context,
environment: input[:environment],
Expand Down Expand Up @@ -52,6 +53,7 @@ def evaluate(context, locals, &block)
syntax: syntax,
load_paths: context.environment.paths,
importer: SassC::Rails::Importer,
precision: ::Sass::Script::Value::Number.precision,
sprockets: {
context: context,
environment: context.environment
Expand Down

0 comments on commit cc1ede7

Please sign in to comment.