4

在 Rails 3.1 中,我必须在我的 scss 文件中附加 .erb 才能在我的 css 中使用图像。不过,这给我带来了 textmate 的问题。

您如何告诉 textmate 始终将 .scss.erb 文件作为 SASS 打开?

这是我的问题的说明: http: //screenr.com/Jjps

4

2 回答 2

3

如果您只需要 .erb sass 文件来包含图像,则可以使用image-urlsass-rails gem 提供的帮助程序。这样您就可以将文件保存为 .css.scss 并且 TextMate 突出显示将起作用。

background: #fff image-url("search.png") no-repeat scroll left center;

更多信息:

http://guides.rubyonrails.org/asset_pipeline.html#css-and-sass

如果您必须 .erb sass 文件,那么 TextMate 中的语法突出显示只能通过为捆绑包中的 scss.erb 文件添加对新语言的支持来修复。这类似于 drnic 流行的 Ruby On Rails 包中的HTML (Rails)语言。

https://github.com/drnic/ruby-on-rails-tmbundle/tree/master/Syntaxes

于 2011-09-24T01:27:25.377 回答
1

这是官方的 SCSS Textmate 包:

https://github.com/kuroir/SCSS.tmbundle

于 2013-01-14T09:21:14.313 回答