1

I am trying to future-proof the css in a zinnia-django blog using compass, susy, and sass. I have successfully copied my zinnia templates into /var/www/static/zinnia by running python manage.py collectstatic. Then I edit a sass file, cd to /var/www/static/zinnia/, and run compass compile. This produces the following errors and causes my blog to not render with css anymore!

error sass/screen.scss (Line 27 of sass/partials/_layouts.scss: Mixin container takes 0 arguments but 2 were passed.) #from running compass compile in shell

On the top of my blog webpage appears the following in firefox:

Syntax error: Mixin container takes 0 arguments but 2 were passed.
     on line 27 of /var/www/static/zinnia/sass/partials/_layouts.scss, in `container'
     from line 27 of /var/www/static/zinnia/sass/partials/_layouts.scss
     from line 20 of /var/www/static/zinnia/sass/screen.scss

Relevant zinnia code is visible on github. At present the code is a virtual mirror of the github repository. Here is line 27, where this error seems to be originating from.

Line 27 of _layouts.scss:

    @include container($total-columns, $screen-layout);

As a clue I was able to learn this. However, I would prefer to use the latest gem versions available to me. I do not know if this compiles with older gems, but the answer to this piece of the puzzle is a bit tangential (though useful). Thus, I need an answer that will me to compile without errors.

Thank you for your help.

mh00h
  • 1,824
  • 3
  • 25
  • 45
  • 2
    If you want to make it easy for people to help you (which gets your question answered faster), put the relevant code in your question. What mixin is being called? How are you invoking the mixin? – cimmanon May 08 '13 at 20:02
  • Thanks; I updated the question with better hyperlinks and included a line of code as well. I hope this makes it easier for someone. – mh00h May 08 '13 at 20:10
  • 1
    Where is the source for the container mixin? – cimmanon May 08 '13 at 20:21
  • I found a few things on this. Location: https://github.com/Fantomas42/django-blog-zinnia/blob/master/zinnia/static/zinnia/sass/ie.scss#L16 Also: the container mixin is part of the \@content directive (http://stackoverflow.com/questions/12768524/what-does-include-container-mean). \@content blocks – mh00h May 08 '13 at 21:06
  • 1
    Looks like zinnia is built with Susy. Do you have the susy gem installed, required, and imported? If so, what version? I think Susy 0.9 had a container mixin without arguments, maybe you need to upgrade Susy? – Miriam Suzanne May 08 '13 at 21:17
  • I found where these variables came from! $total-columns and $screen-layout variables are coming from: https://github.com/Fantomas42/django-blog-zinnia/blob/master/zinnia/static/zinnia/sass/config/_base.scss#L9 Looking at Susy, I am using version 1.0.8. – mh00h May 08 '13 at 21:20
  • It also looks like `require 'susy'` is already built into my config.rb file (https://github.com/Fantomas42/django-blog-zinnia/blob/master/zinnia/static/zinnia/config.rb) – mh00h May 08 '13 at 21:29
  • 1
    Is something overwriting the container mixin? If the mixin didn't exist at all, the error would be completely different. – cimmanon May 09 '13 at 00:07
  • I ran `grep 'container' /var/www/static/zinnia/* -R` to look for it but didn't see anything to my untrained eyes. BUT: I finally found where container is really comming from. http://compass-style.org/reference/blueprint/grid/#mixin-container – mh00h May 09 '13 at 03:39
  • http://susy.oddbird.net/guides/getting-started/#start-basic also may provide some good clues into interpreting _layouts.scss – mh00h May 09 '13 at 22:28

3 Answers3

3

I ran into the same error, even with the order of importing compass before susy. What fixed it for me was uninstalling this no-longer-used gem: compass-susy-plugin.

Jason L
  • 133
  • 3
2

I got the same error while using susy 2.1.1. It was fixed by replacing @import "susy" with @import "susyone". This way susy reads susy 1.x syntax.

Nuno Lages
  • 21
  • 1
1

Updated Answer - Import Order

I suspect (I do not have a means of testing) the error is in the load order of your components. In this zinnia file, lines 7-8 look like this:

@import "susy";
@import "compass";

So the compass definition of the container mixin (that does not have variables) is going to overwrite the susy mixin of container that does have them. Since susy is built off compass, the order should probably be:

@import "compass";
@import "susy";

This may resolve the other issues you note as well.

ScottS
  • 71,703
  • 13
  • 126
  • 146
  • Yes, I looked at that. I also ran the code without variables in that container. However, I get a continuation of errors working it's way down the entire _layout.scss file, so I think there is a different problem that we haven't gotten to the bottom of. If we run the code without variables in the container, the following error occurs: ``Line 38 of sass/partials/_layouts.scss: Undefined mixin 'at-breakpoint'`` Since both of these things are part of susy, there's got to be more to this story!! Delete at-breakpoint, and you get a new error. I agree that there is an error in Zinnia. Thanks. – mh00h May 12 '13 at 02:57
  • Also, reverting to the version of gems the author mentioned continues to give me a mixin error, so it's clear that `_layout.scss` has a bug somewhere. – mh00h May 12 '13 at 03:17
  • @mh00h: Everything does seem to revolve around mixins defined in `susy`, and I believe I may have isolated the issue so I updated my answer. – ScottS May 12 '13 at 11:05
  • Yes! It seems susy is not loading. I tried importing susy last per your suggestion but its still not loading. Commenting all compass imports out didn't fix it for me either, so I'm going to look at it some more this week and will report back now that the trail is no longer cold. Once I get this going I'll report back later this week and mark correct answers and stuff. Thanks! – mh00h May 13 '13 at 06:01