concat string with sass

1,408 views
Skip to first unread message

ricard.forniol

unread,
Nov 17, 2009, 5:46:33 PM11/17/09
to Haml
Hi;

I'm trying to do something like that:

background(!image)
:background url(/facebox/#{!image})

But I don't know if it's possible. This code says Undefined variable:
"!image".

Thanks

Chris Eppstein

unread,
Nov 17, 2009, 5:49:48 PM11/17/09
to ha...@googlegroups.com
mixins are defined with an equals sign:

=background(!image)
  background: url(/facebox/#{!image})

Then you can mix it in like so:

div
  +background("foo.png")


--

You received this message because you are subscribed to the Google Groups "Haml" group.
To post to this group, send email to ha...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/haml?hl=.



ricard.forniol

unread,
Nov 17, 2009, 7:23:51 PM11/17/09
to Haml
Thanks I missed "=", I have improved it.

=background(!class)
.#{!class}
:background url(/images/facebox/#{!class}.png)

It works like a charm!!!

On 17 Nov, 23:49, Chris Eppstein <ch...@eppsteins.net> wrote:
> mixins are defined with an equals sign:
>
> =background(!image)
>   background: url(/facebox/#{!image})
>
> Then you can mix it in like so:
>
> div
>   +background("foo.png")
>
Reply all
Reply to author
Forward
0 new messages