There was a series of checkins a couple weeks ago that added some
great new capabilities to sass. There's still a few missing bits and
as you can see from this thread the syntax may still in flux. Since
none of this has been documented nor part of an official sass release,
use them at your own risk.
That said here's a bullet list of the new features that Nathan added:
* Passing arguments to mixins
=my-mixin(!width, !color = #000)
:border= !width solid !color
.selector
+my-mixin(5px, #ccc)
.another-selector
+my-mixin(5px)
* Selector interpolation
.selector-#{!foo}
* Iterative looping (for)
@for !n from 1 to 11
.border-#{!n}
:border-width= !n+px
* Conditional looping (while)
!n = 1
@while !n != 16
.gray-#{!n}
:color= #111 * !n
!n = !n + 1
* Conditionals
@if !n = 5px
:border= !n dashed #ccc
(@else is still pending)
* Boolean logic (to support the above features)
I use most of these features to render the blueprint grid (which was
the primary use-case for this feature). You can find an example here:
http://github.com/chriseppstein/compass/tree/master/frameworks/blueprint/stylesheets/blueprint/modules/_grid.sass
Cheers,
Chris
On Aug 28, 2:58 am, pimpmaster <[EMAIL PROTECTED]> wrote:
> Wow, this looks pretty cool!
>
> I am already using mixins with great success and had no idea you could
> pass variables
>
> How exactly is this done??
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---