Set a custom images path in Scout

1.2k Views Asked by At

I'm using the Scout app on Windows 7 to easily work with SASS/Compass. I'm having some incredibly annoying experiences trying to customize the images path that Scout should use.

The Scount configuration UI actually offers a field to set my images path, so I set it to something like this:

c:\myproject\img

Next I use a rule in my .SCSS file, for example:

@include background(image-url("bg_skin.png"));

This compiles into CSS having an image path like this:

/images/img/bg_skin.png

Which obviously breaks my image path. I think I am missing the logic here of why I am given the option to set a path, after which it is completely overruled anyway.

As more users seem to have this issue, an update was released:

http://www.continuousthinking.com/2012/05/14/scoutapp-0-6-0-rc1.html

This update allows one to create a custom config file to set paths and such, which will then be used. So I created that file and tell Scout to use it:

images_dir = "../img"

This compiles into image paths in the CSS like this:

/../img/bg_skin.png

Note the leading slash. Again a user-configured path is overruled and again it breaks my path. All I want to do is to tell Scout to use my "img" directory. This drives me insane.

1

There are 1 best solutions below

0
Hauleth On

If you really want to get relative paths you need to add relative_assets = true to your config.rb. It is all described in that file when you create new project with compass create:

# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true