Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 331
MMA Avatar asked Feb 28 '26 13:02

MMA


1 Answers

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).

like image 187
Maxime Fabre Avatar answered Mar 03 '26 03:03

Maxime Fabre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!