MMA
MMA

Reputation: 525

Compass Sass Framework Sprite Path and Layout setting (SASS/CSS)

I am using Sass & Compass Framework for compiling my CSS. I am working in my local environment. When I dealing with the Compass Sprite image generation, I am encountering two different problems.

  1. I want to set the layout to horizontal or smart or anything other than default vertical but I could not. I checked the syntax and I am using the right one, folder name plus the layout, but could not get it to work. All other setting like gap, spacing, all work.

  2. I currently do not have a server running. I need a relative path from my css folder to image folder. Something like this "../images/xxx.png". Compass is all using the absolute file path based on my config file. Is there anyway that I could set setting to use relative path instead of absolute path? I tried the URL helper mixin which also generate the absolute path.

I am great appreciated for all the helps. Thanks.

Upvotes: 3

Views: 3191

Answers (1)

Maxime Fabre
Maxime Fabre

Reputation: 2252

For the #2 use relative_assets = true in your config file.

If your aren't already I also suggest you use the stylesheet-url and image-url Compass functions that calculate automatically the path to your configured image and css folders, from where you call them. If you call image-url(myfile.jpg) from a .css file in your css folder, it will compile to url(../images/myfile.jpg).

Upvotes: 5

Related Questions