Susy: question about +omega mixin

55 views
Skip to first unread message

Charles Roper

unread,
Nov 4, 2009, 3:25:41 AM11/4/09
to compas...@googlegroups.com
Hey Eric (and others who may know the answer to this),

In the readme for Susy, it states, in relation to the +omega and other
mixins:

"In nested contexts, all of these mixins take an extra final argument,
the width in columns of the parent (nesting) element."

In studying the Sass for Susy (_grid.sass), this statement had me
totally scratching my head. I couldn't see why or how the width in
columns came into it; seemingly you're just flipping a boolean to true,
rather than actually setting a value. This had me confused for quite
some time (I know, I'm a bit slow) as I thought there *must* be
something I misunderstood about Susy, Sass or Compass for the code to
say one thing, while the docs suggested another.

But anyway, can I just confirm that we can set that value to *anything*
and it will have the same effect? That is, the presence of any value
other than nil returns True? Actually, even nil seems to get implicitly
converted to a string and therefore returns True.

Or have I indeed misunderstood something, somewhere?

Cheers,
Charles

p.s Really enjoying messing about with Susy so far.

Eric Meyer

unread,
Nov 4, 2009, 4:57:56 AM11/4/09
to Compass
Charles,

Glad you are enjoying Susy so far. You are absolutely right. All the
code cares about with +omega is if you are in a nested context or not.
I wrote the tutorial (and all my own production code) with the
specific context for simplicity. It keeps a consistent syntax with the
other mixins (+culumns, +pad, etc.) that do need to know the exact
context, and '3' is easier to write anyway than '"True"'.

Now that you've discovered my secret, you can do as you like. I still
plan to recommend supplying context. I think it's a good habit to be
in for using Susy as a whole.

Cheers,
Eric

Charles Roper

unread,
Nov 4, 2009, 8:50:44 AM11/4/09
to compas...@googlegroups.com
Hi Eric,

2009/11/4 Eric Meyer <erii...@gmail.com>:


> Now that you've discovered my secret, you can do as you like. I still
> plan to recommend supplying context. I think it's a good habit to be
> in for using Susy as a whole.

Good to know, thanks for the explanation. I agree entering the context
makes sense and it is indeed much easier than typing "True". Perhaps
all that's required to avoid confusing newbies like me is a little
explanation on this somewhere, perhaps in the source?

Cheers,
Charles

Eric Meyer

unread,
Nov 4, 2009, 1:26:43 PM11/4/09
to Compass
Good call. I'll get that in.

Cheers,
Eric



On Nov 4, 8:50 am, Charles Roper <reac...@charlesroper.co.uk> wrote:
> Hi Eric,
>
> 2009/11/4 Eric Meyer <eriii...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages