Examine the following snippet:

=mixin(!a, !b, ..)
        prop-a: !a
        prop-b: !b ..

It works fine if all arguments are provided even if I provide empty
value e.g. "" or " ". So, to deal with this one, I made me self a
short mixin:

=property?(!property, !value)
        @if !value != ""
                @if !value != "inherit"
                        @if !value != "transparent"
                                @if !value != "none"
                                        #{!property}: #{!value}

which I use like this

=mixin(!a = "", !b = "", ..)
        +property("prop-a", !a)
        +property("prop-b", !b) ..

which works better and omits empty values. However, to me it would be
nice to make something like

=mixin(!a, !b, ..)
        ? prop-a: !a
        ? prop-b: !b ..

which would do the same thing -- if !a exists, and is not "", and is
not " ", then add this line to the css.
--~--~---------~--~----~------------~-------~--~----~
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