Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS SASS: Compass adding slash infront of images directory when creating sprites

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #41562
    jdk
    Member

    I am using Compass/SCOUT to create sprites. It creates fine, but the css output is pointing to the wrong images directory (Adding extra Forward SLASH infront of the images directory) like so:

    .icon-sprite {
    background: url(‘/images/icon-s6f4a44e28d.png’) no-repeat;
    }

    instead of:

    .icon-sprite {
    background: url(‘images/icon-s6f4a44e28d.png’) no-repeat;
    }

    I am using style.scss to call sprites like so:

    @import “compass”;
    @import “icon/*.png”;

    and config.rb:

    http_path = “/”
    css_dir = “”
    sass_dir = “scss”
    images_dir = “images”

    When tried to uncomment #relative_assets = true, it gives me an error.

    Any sugestions please!

    #118869
    hotpink
    Member

    Just an idea.

    In config.rb try this…

    images_dir = “./images”

    #118886
    jdk
    Member

    @hotpink Thank you, and that still shows a wrong directory, like so:

    .icon-sprite {
    background: url(‘/./images/icon-s6f4a44e28d.png’) no-repeat;
    }

    #118901
    jdk
    Member

    @Htmlmainiac, Thank you but that did not work for me. Here are my directory system http://i.imgur.com/EwYVq.png

    #119158
    AqoonKaal
    Member

    Change

    http_path =’/’

    To

    http_path =’./’

    That would eliminate the slash.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.