chriseppstein/compass — Issue #594: Support importing from dependency projects
Author: sean-lynch
Created: 2011-10-08 01:47:30+00:00
State: open

Compass newbie here, so if I'm misunderstanding how it works, I'll be happy to find out I'm wrong.

It seems that compass is built up around the notion of a single project which contains subdirectories for ALL stylesheets, ALL images, ALL javascript, etc.

Unfortunately, I'm coming from a world of maintaining multiple very small projects that share a central set of dependencies. In this world, the main project may use @import directives to pull in files and resources from outside the project root (given that those dependencies are shared between multiple projects). My hack was to use relatives paths in the @import directive to reach outside the project and point to the appropriate scss (for example @import ../../../path/to/file.scss). Not only is it gross but it quickly breaks down in the following case:

/project
/project/images/main.gif
/project/stylesheets/main.scss
/dependency
/dependency/images/other.gif
/dependency/stylesheets/other.scss

I can use a relative path in main.scss to reference other.scss (hack), but if main.scss uses a relative path to call inline-image(main.gif) and other.scss uses a relative path to call inline-image(other.gif), compass won't be able to find other.gif because the path in other.scss is not relative to the main project.

Compass provides a command line flag to specify the image path, but it doesn't allow specifying multiple paths which means it's impossible to set up multiple dependent projects.

There could be a few fixes here:
- Take into account relative paths on @imports and apply them to paths in inline-image/inline-font, and other import calls
- Allow specifying multiple project_pathes
- Allow specifying multiple javascript, images, and font paths