Compass Sass Framework Sprite and Layout Adjustment (SASS / CSS)

I am using Sass and Compass Framework to compile my CSS. I work in my local environment. When I go about building a Compass Sprite image, I run into two different problems.

  • I want to set the layout to horizontal or smart or other than the default vertical, but I couldn't. I checked the syntax and I'm using the correct one, folder name plus layout, but couldn't get it to work. All other settings like clearance, spacing all work.

  • I currently don't have a server. I need a relative path from my css folder to my images folder. Something like this "../images/xxx.png". Compass uses an absolute file path based on my config file. Is there anyway I can set the preference to use a relative path instead of an absolute path? I tried the helper mix url which also generates an absolute path.

I am very grateful for the help. Thank.

+3


source to share


1 answer


For # 2 use relative_assets = true

in your config file.



If you haven't already, I also suggest you use the stylesheet-url and image-url Compass functions , which automatically calculate the path to your customized images and css folders from where you name them. If you call image-url(myfile.jpg)

from a .css file in your css folder it will compile with url(../images/myfile.jpg)

.

+5


source







All Articles