Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compass is giving me wrong path to sprite

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?

like image 424
Marcel Huss-Nielsen Avatar asked Sep 14 '12 09:09

Marcel Huss-Nielsen


1 Answers

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.

like image 113
Beau Smith Avatar answered Sep 19 '22 13:09

Beau Smith