1

I have been to this page: Background images path in Sass and Compass and it seems like it should be the answer to my question, but I am missing something. Here is my code:

config.rb

images_dir = 'img'

sass file

header { background: image-url('raeshineLogo.png', false, false); }

which outputs to:

  header {
  background: url('/img/raeshineLogo.png');
  }

Seems like it should work, the path is correct, but what am I missing?

Community
  • 1
  • 1
Rachelle
  • 41
  • 4
  • If th URL starts with a / (for instance, `url(/img/...`), the path is absolute, and not relative. This means the img folder is being looked up on the sites root directory, and not in the (let's say) css/img directory. – Santiago Baigorria Oct 15 '14 at 19:19
  • Is there a way to make it stop outputting that / ? I saw this in the page that is linked above: `relative_assets = true` but I am not having any luck. – Rachelle Oct 15 '14 at 19:55
  • The path is raeshine/img, where raeshine is the root directory. In the config.rb file, I have: `css_dir = 'css'`, and that one works. The JS folder is also ok, so I'm very confused why the img folder is not found in the same way. – Rachelle Oct 15 '14 at 20:23

1 Answers1

3

Solved! As I thought, it was a silly mistake. But it turned out to have nothing to do with the path.

If anyone happens upon this page with a similar issue, see link above to the other Stack Overflow question, and this page: http://compass-style.org/reference/compass/helpers/urls/ (part of maxbeatty's answer).

Rachelle
  • 41
  • 4