Why sprites must be in the project path ?

548 views
Skip to first unread message

MoOx

unread,
May 26, 2011, 3:34:13 AM5/26/11
to Compass
Hi,

I've an issue that make me do some weird stuffs. So with my project, I
compile standalone file, in a temporary directory. Options are set
using a generated config.rb, so I'm using full path. Here is an
example:

Cmd line:
/usr/bin/compass compile --force --trace --config /private/var/tmp/
assetic_compassJDpBIh --sass-dir /private/var/tmp --css-dir /private/
var/tmp /private/var/tmp/assetic_compassGevoN1.scss

Config file:
----
http_path = "/wp-content/themes/WEBSITE"
images_dir = "/Users/moox/Sites/WEBSITE/wordpress/wp-content/themes/
WEBSITE/i/"
http_images_path = "i/"
additional_import_paths = [
"/Users/moox/Dropbox/Repositories/Compass-Recipes/src",
"/Users/moox/Sites/WEBSITE/wordpress/wp-content/themes/WEBSITE/
stylesheets"
]
----

With this i'm having the following error:
NoMethodError on line 54 of /Library/Ruby/Gems/1.8/gems/compass-0.11.1/
lib/compass/sass_extensions/sprites/base.rb: undefined method `top'
for nil:NilClass
...

So I've compare what is wrong with this method, because, before that I
was using compass in a normal way and not with a PHP filter :)

My config file in /Users/moox/Sites/WEBSITE/wordpress/wp-content/
themes/WEBSITE/stylesheets/
----
css_dir = ".."
sass_dir = "."

add_import_path "/Users/moox/Dropbox/Repositories/Compass-Recipes/src"

http_path = "/wp-content/themes/WEBSITE"
images_dir = "../i"
http_images_path = "i/"
----
The problem is that the images_dir must begin with the sass_dir (or
<project_path>). Why ?
Don't tell me I will never use my PHP based filter pleaaaseee :)

Chris Eppstein

unread,
May 26, 2011, 3:42:07 AM5/26/11
to compas...@googlegroups.com
images_dir is relative to the project_path, but you can set images_path instead if you need to set it absolutely.

There's corresponding xxx_dir and xxx_path forms for all of the directory configuration options:
http://compass-style.org/help/tutorials/configuration-reference/

alternatively, you can pass --images-dir on the command line and it will set images_dir or images_path accordingly if it is an absolute path.


--
You received this message because you are subscribed to the Google Groups "Compass" group.
To post to this group, send email to compas...@googlegroups.com.
To unsubscribe from this group, send email to compass-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/compass-users?hl=en.


MoOx

unread,
May 26, 2011, 5:04:26 AM5/26/11
to Compass
You are my hero !
Reply all
Reply to author
Forward
0 new messages