如何在 CSS 输出中启用 SASS 行号?
如果我使用 SASS,如何在 CSS 输出中启用行号?我找到了一篇文章,但不太明白在哪里进行修改
http://pivotallabs.com/users/damon/blog/articles/765-standup-04-07-2009-we-have-questions#comments
可以你帮我吗?
How can I enable line numbers in CSS output if I am using SASS? I found an article but I didn't quite understand where to make the modifications
http://pivotallabs.com/users/damon/blog/articles/765-standup-04-07-2009-we-have-questions#comments
Could you help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一个名为
:line_comments
的选项,如果将其设置为 true,Sass 会将行号放入编译的输出中。如何设置此选项取决于您如何使用 Sass。如果它在 Rails、Merb 或 Rack 应用程序中,您可以设置
Sass::Plugin.options[:line_comments] = true
。如果您使用指南针,请在配置文件中设置
line_comments = false
。There's an option called
:line_comments
if you set this to true, Sass will place line numbers in your compiled output.How to set this option depends on how you're using Sass. If it's in a Rails, Merb, or Rack application you can set
Sass::Plugin.options[:line_comments] = true
.If you're using compass, set
line_comments = false
in your configuration file.如果您碰巧使用 Sprockets 和 sprockets-sass gem,您可能需要这样做这:
If you happen to be using Sprockets and the sprockets-sass gem, you may need to do it like this:
有人建议这个猴子补丁:
猴子补丁有效,但我认为这效果更好: https://github.com/rails/sass-rails/pull/181
现在,您必须从 master 分支拉入rails-sass。
Someone suggested this monkey-patch:
The monkey-patch works, but I think this works even better: https://github.com/rails/sass-rails/pull/181
For now, you have to pull in rails-sass from the master branch.