2009-12-01 25 views

回答

10

如果將此設置爲true,則有一個選項:line_comments,Sass會將行號放入編譯後的輸出中。

如何設置此選項取決於您如何使用Sass。如果它在Rails,Merb或Rack應用程序中,則可以設置Sass::Plugin.options[:line_comments] = true

如果您使用指南針,請在您的配置文件中設置line_comments = false

+0

好的,我在config.rb文件中添加了'line_comments = false',但仍然沒有改變...我使用指南針,我做錯了什麼? – hex 2009-12-01 14:00:31

+2

在compass.config中,sass_options = {:line_comments => true} – Kyle 2009-12-01 17:45:55

+0

最近修復了羅盤中的錯誤。如果你可以升級到0.10.0.pre2或更高,它將工作。或者你可以做到凱爾的方式。 – chriseppstein 2009-12-01 19:25:11

1

如果你碰巧使用鏈輪和​​寶石是,你可能需要做的是這樣的:

Sprockets::Sass.options[:line_comments] = true 
0

有人建議這個猴子補丁:

# Had to use this instead as per comment by @glebtv https://github.com/rails/sass-rails/issues/157 
module Sass 
    class Engine 
     def initialize(template, options={}) 
     @options = self.class.normalize_options(options) 
     @options[:debug_info] = true 
     @template = template 
     end 
    end 
end 

猴子補丁但我認爲這樣做效果更好:https://github.com/rails/sass-rails/pull/181

現在,您必須從主分支中提取rails-sass。

group :development, :test do 
    gem 'sass-rails', '~> 4.0.0', git: 'https://github.com/rails/sass-rails.git', branch: 'master' 
end