Marcel Huss-Nielsen
Marcel Huss-Nielsen

Reputation: 105

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?

Upvotes: 9

Views: 3692

Answers (1)

Beau Smith
Beau Smith

Reputation: 34367

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.

Upvotes: 4

Related Questions