Hi y'all,

As I mentioned the other day, I'm working on a framework for css grid
frameworks.  One thing I noticed in my work is that the concatenation
I needed to do wound up feeling hackish.

What I'm doing is dynamically generating a grid given spacing, width,
and a set number of columns.  So, I have to have an unknown number of
".grid-N" classes that all get assigned global settings (to save
space).  Here's what I have to do right now.

>  !parts = ""
>  @for !i from 1 through (!columns - 1)
>    !parts = "#{!parts}#{!container} .grid-#{!i}, "
>  #{!parts}#{!container} .grid-#{!columns}
>    float:    left
>    display:  inline
>    margin-left=   !space
>    margin-right=  !space

Here's an idea, a generator for a group of elements given a format
that operates like @for.  Such as:

> @select-from "#{!container} .grid-#{!i}" where !i is 1 to (!columns - 1)

I know it's lisp like, but no more so than @for is.  ;-)  I'd give a
shot on putting it together, but I've never written a parser (or
parser addition) in all my life.

Cheers,
Flea
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to