9

config rb is running default values. the folder structure is also the default one.

in my scss file i do.

@import "icons/*.png";

@mixin sprite_css($name) {
@include icons-sprite($name);
height: icons-sprite-height($name);
width: icons-sprite-width($name);
display:block;
}


.btn {@include sprite_css(deltag);}  //deltag is the name of a png image in the sprite.

Prior to this i made a folder under the images folder, called icons here i put all my png files in.

The generated css code looks like this.

.icons-sprite, .icons-deltag, .icons-deltag_grey, .icons-deltag_mouseover, .icons-facebook_del, .icons-faneblad, .icons-soegefelt, #container .btn, #container .btn_over {
background: url('/images/icons-s93e62b2fff.png') no-repeat;
}`

notice the background path is set without the trailing dots infront of images folder, so my CSSfile that is placed in the stylesheets folder is now looking for an image folder inside the stylesheets folder, so obviously the files are not loaded. I cant seem to change this anyway. changing config rb to relative_assets = true is not working.

I want the css file to point the sprint to.

background: url('../images/icons-s93e62b2fff.png') no-repeat; 

that is the correct path, how can i achieve this?

1
  • 2
    UPDATE: i closed my command promt and all the files to take a break. When i started compass up again and executed compass --watch it all worked fine, so i guess the relative_assets = true does in fact work, you just have to restart compass first. Sep 14, 2012 at 11:00

1 Answer 1

4

The Compass config.rb file is loaded each time you run a Compass command. If you are running compass watch you must exit the process and then start it again in order to reload changes to the config.rb file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.