如何启用CSS输出线号,如果我使用SASS?我发现了一篇文章,但我不太明白的地方进行修改

HTTP ://pivotallabs.com/users/damon/blog/articles/765-standup-04-07-2009-we-have-questions#comments

你能帮助我吗?

有帮助吗?

解决方案

有一个称为:line_comments如果设置为true,萨斯将把行号在你的编译输出的选项。

如何设置这个选项取决于你如何使用萨斯。如果它是在Rails,Merb的,或机架式应用程序可以设置Sass::Plugin.options[:line_comments] = true

如果你使用指南针,在配置文件中设置line_comments = false

其他提示

如果你碰巧使用链轮和链轮,萨斯宝石,你可能需要做到这一点是这样的:

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

有人建议这种猴的贴剂:

# 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

有关现在,必须在轨道-SASS拉从主分支。

group :development, :test do
  gem 'sass-rails', '~> 4.0.0', git: 'https://github.com/rails/sass-rails.git', branch: 'master'
end
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top