SASS Mixin with Arguments?

258 views
Skip to first unread message

andysky

unread,
Jan 23, 2009, 4:29:37 PM1/23/09
to Haml
Is there any way to have a mixin act more like a method with
arguments? Something like:
----
=border-radius( arg )
:-moz-border-radius $arg
:-webkit-border-radius $arg
----

and then, to include it, eg:
----
#sidebar
+border-radius 10px
----

Chris Eppstein

unread,
Jan 23, 2009, 4:38:18 PM1/23/09
to ha...@googlegroups.com
This feature is implemented on edge haml & sass. This syntax goes like so:

=mixin(!arg1, !arg2 = "default-value")
  :foo= !arg1
  :bar= !arg2

For a look into the sorts of things that can be accomplished with the new sass features some of the following sass examples:

andysky

unread,
Jan 23, 2009, 4:50:56 PM1/23/09
to Haml
Yes... Yum yum... tasty syntax... How stable is this edge haml & sass?

..And I guess I get from a branch on github?


On Jan 23, 9:38 pm, Chris Eppstein <ch...@eppsteins.net> wrote:
> This feature is implemented on edge haml & sass. This syntax goes like so:
> =mixin(!arg1, !arg2 = "default-value")
>   :foo= !arg1
>   :bar= !arg2
>
> For a look into the sorts of things that can be accomplished with the new
> sass features some of the following sass examples:
>
>    -
>    http://github.com/chriseppstein/compass/blob/master/frameworks/bluepr...
>
>    -http://compass-style.org/hl/application.sass
>
> Chris

Chris Eppstein

unread,
Jan 23, 2009, 4:55:42 PM1/23/09
to ha...@googlegroups.com
Pretty stable we're using it in production at caring.com. And yes, grab the code from github and run "rake install".

chris

andysky

unread,
Jan 23, 2009, 5:27:30 PM1/23/09
to Haml
Thanks, Chris. I'll try that tomorrow.

BTW, I just gave it a quick look for now, but Caring.com seems a very
important and necessary site -- I thank you for working on it.

All the best to you.

-Andy


On Jan 23, 9:55 pm, Chris Eppstein <ch...@eppsteins.net> wrote:
> Pretty stable we're using it in production at caring.com. And yes, grab the
> code from github and run "rake install".
> chris
>
Reply all
Reply to author
Forward
0 new messages