Compass creates duplicate stylesheet directory

533 views
Skip to first unread message

Ian

unread,
Dec 8, 2011, 8:23:49 AM12/8/11
to Compass
I've just changed my project structure to include all stylesheets,
images, and scripts in an assets folder like this:

project
config.rb
assets
images
javascript
stylesheets
css
sass

In config.rb I have tried setting my css_dir path to "assets/
stylesheets/css" and sass_dir to "assets/stylesheets/sass" but
whenever I put a watch on my stylesheets directory it runs OK but then
creates another "stylesheets" folder inside of stylesheets like this:

stylesheets
css
sass
stylesheets

An in that new 'stylesheets" folder is where it places my compiled CSS
files instead of in the "css" directory.

How can I correct the compiled output path?

Andrés gutiérrez

unread,
Dec 8, 2011, 8:30:25 AM12/8/11
to compas...@googlegroups.com
Maybe that help you:
http://compass-style.org/help/tutorials/configuration-reference/

2011/12/8 Ian <creati...@googlemail.com>

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


Ian

unread,
Dec 8, 2011, 8:45:33 AM12/8/11
to Compass
I have already referred to the docs and like I mentioned above I've
already set the css_dir configuration rule:

css_dir = "assets/stylesheets/css"

If this is incorrect then maybe you can offer something a little more
specific as to how it should be set?

Ian

On Dec 8, 1:30 pm, Andrés gutiérrez <andresgut...@gmail.com> wrote:
> Maybe that help you:http://compass-style.org/help/tutorials/configuration-reference/
>

> 2011/12/8 Ian <creativev...@googlemail.com>

Ian

unread,
Dec 8, 2011, 2:09:14 PM12/8/11
to Compass
I've tried this with both new and existing projects and I get the same
result. With new projects it's actually quite strange. I initiate the
project with the following commands:

compass create templates --sass-dir "assets/stylesheets/sass" --css-
dir "assets/stylesheets/css" --javascripts-dir "assets/scripts" --
images-dir "assets/images"

Initially it seems that this works. I get the correct directory
structure with sass files in the sass/ directory and css files (wait
for it...) in the css/ directory. I then setup the watch on the
stylesheets/ directory and make some changes in screen.css. When
Compass detects those changes it then creates a NEW directory:
stylesheets/ inside my existing sytlesheets directory and puts all css
files in there too. Even though it created the project with the
correct settings and the same correct settings still in the config.rb
file.

This has got to be a bug in Compass? Can anyone run a test and
confirm?

Steps to reproduce:

1) create a new project with the following settings:

compass create templates --sass-dir "assets/stylesheets/sass" --css-
dir "assets/stylesheets/css" --javascripts-dir "assets/scripts" --
images-dir "assets/images"

2) Notice correct directory structure

3) Put a watch on the stylesheets directory

4) Make changes to screen.scss and save.

5) Notice new stylesheets directory with same .css files in but all
new updates are placed in this directory. (project/assets/stylesheets/
sytlesheets/)


Running:

compass --version
Compass 0.11.5 (Antares)

ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]

Using RVM. 1.9.3p0 set as default

Ian

Ian

unread,
Dec 9, 2011, 9:53:15 AM12/9/11
to Compass
On further tests I've found a solution to the problem. It seems that
the config.rb file needs to be either in the assets/ directory or the
stylesheets/ directory to prevent this from happening. So this works:

project/
assets/
config.rb
stylesheets/
css/
sass/

With settings in the config.rb file set to:

css_dir = "stylesheets/css"
sass_dir = "stylesheets/sass"

This also works:

project/
assets/
stylesheets/
config.rb
css/
sass/

With settings in the config.rb file set to:

css_dir = "css"
sass_dir = "sass"

With either of these setups compilation of the stylesheets obeys the
settings in config.rb and correctly places the compiled CSS in the
css/ directory.

My questions are:

1) Why doesn't it work when the config.rb file is placed in the
project root, as it is when it's created using the "compass
create ..." command (even with specified sass and css directories)?
Why does it then ignore the config.rb file and create a random new
"stylesheets" directory?

2) Given either of the above two scenarios work I'll follow one of
those but should I be placing config.rb in the assets/ directory or
the stylesheets/ directory (see directory structures above)?

3) How does this affect settings in the config.rb file such as
http_path? Is this still set to "/"?:

http_path = "/"

4) Is this intended behaviour or more of a bug? I've been through all
the documentation (and the book) and can't find any reference to this
anywhere. If it's intended behaviour it could be good to make note of
this in the docs somewhere to prevent confusion for non-standard
Compass directory structures.


Thanks,

Ian

Scott Davis

unread,
Dec 9, 2011, 9:55:37 AM12/9/11
to compas...@googlegroups.com
You can always pass
-c to compass and give it the config file

Sent from my iPhone

Ian

unread,
Dec 9, 2011, 10:02:21 AM12/9/11
to Compass
Is -c the flag to set the path of the config.rb file?

Something like:

compass create project -c assets/ ... ?

Ian

On Dec 9, 2:55 pm, Scott Davis <jetvipe...@gmail.com> wrote:
> You can always pass
> -c to compass and give it the config file
>
> Sent from my iPhone
>

Ian

unread,
Dec 9, 2011, 10:15:18 AM12/9/11
to Compass
That doesn't seem to _set_ the location of the config.rb file, only
tell it where to look by the looks of things but when creating a new
project there isn't one to start with.

At the moment it seems that you can create a new Compass project from
the command line along with instructions for the locations of the css-
dir and sass-dir but you have to then manually move the config.rb file
into the assets folder from the project root.

Ian

Scott Davis

unread,
Dec 9, 2011, 10:30:23 AM12/9/11
to compas...@googlegroups.com
Compass <command> -c <path to config>

Sent from my iPhone

Ian

unread,
Dec 9, 2011, 11:10:32 AM12/9/11
to Compass
Like I said, when using that command when creating it doesn't seem to
tell it to create the config.rb file in that path, it only looks for
it there. So that doesn't really help when creating the project. It
still doesn't alter the fact that after creating you need to manually
drag your config.rb file to another directory... unless I'm missing
something...?

Ian

On Dec 9, 3:30 pm, Scott Davis <jetvipe...@gmail.com> wrote:
> Compass <command> -c <path to config>
>
> Sent from my iPhone
>

Caterina

unread,
Jan 26, 2012, 4:40:40 PM1/26/12
to Compass
Hello,
I don't know if you already solved your problem. However I had a
similar issue today (I couldn't even change the css output from
compressed to extended) and I found out that all you have to do is
stop watching your sass folder *before* editing the config.rb file.
You can then change your directory or any other settings and when you
run "compass watch" command everything will work as expected.

Now I can work with my preferred folder structure and I could rename
the 'stylesheet' folder to 'css':

httpdocs/
compile/
sass/
.sass_cache/

inc/
css/
fonts/
img/
js/


Hope this can help.
Cheers

Alex Tetragon

unread,
Feb 24, 2012, 6:03:42 AM2/24/12
to compas...@googlegroups.com
Hi, that really really helped me Caterina, thanks. I was suffering from the "Invalid CSS after "...icons-clean-up,": expected function argument, was ");") problem when trying to include the sprite module, which seems to occur when it can't find the relevant directory. Although I'd changed the images dir in the config.rb file, it didn't register the change until I'd quite compass and restarted.

Cheers,

Alex
Reply all
Reply to author
Forward
0 new messages