开发者

How to tell textmate to open .scss.erb files as SASS?

开发者 https://www.devze.com 2023-04-05 10:22 出处:网络
With Rails 3.1 I have to appendmy scss files with .erb to use images in my css. It\'s causing me a problem 开发者_如何学JAVAwith textmate though.

With Rails 3.1 I have to append my scss files with .erb to use images in my css. It's causing me a problem 开发者_如何学JAVAwith textmate though.

How do you tell textmate to always open .scss.erb files as SASS?

Here's an illustration of my problem: http://screenr.com/Jjps


If you only need to .erb the sass files to include images, you can use the image-url helper provided by the sass-rails gem. This way you can keep files as .css.scss and TextMate highlighting will work.

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

More info:

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

If you have to .erb the sass files then the syntax highlighting in TextMate will only be fixed by adding support for a new language for scss.erb files in a bundle. This would be similar to the HTML (Rails) language in the popular Ruby On Rails bundle by drnic.

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


Here's the official SCSS Textmate bundle:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号