[Sass & Compass] Compass: 生成される CSS の画像パスを変更する

画像パスを config.rb の設定でコントロールします。

[markdown]
> * [orangemittoo’s blog • compassで画像を使う時のパス](http://orangemittoo.tumblr.com/post/43478293498/compass)

例えばこんな設定をしていると、

“`ruby:config.rb
# Set this to the root of your project when deployed:
# http_path = “./theme”
css_dir = “src/css”
sass_dir = “src/sass”
images_dir = “src/img”
javascripts_dir = “src/js”
# http_generated_images_path = “/img”
# relative_assets = true
“`

生成された CSS の画像パスは、下記のようになりますが、

“`css
background-image:url(/src/img/globalnav-s47f9160579.png);
“`

(コメントを外し)`http_generated_images_path` を設定すると、`/img` から始まるパスに変わります。

## 補遺

その他の設定項目。

> * [【Webデザイナ-・コーダー向け】すぐに使えるSCSS入門|設定ファイルを知っておこう – 番外編 | Developers.IO](http://dev.classmethod.jp/ria/html5/web-desiner-corder-scss-config/)
> * [Compassの設定ファイル「config.rb」の編集方法 | 株式会社LIG](http://liginc.co.jp/web/html-css/css/53075)

Grunt の例。

> * [Compass+GruntでCSSスプライトを使う | chikathreesix](http://chikathreesix.com/?p=167)
[/markdown]