Inheriting attributes from the caller mixin

20 views
Skip to first unread message

Sahand Saba

unread,
Jul 7, 2014, 11:58:02 PM7/7/14
to jad...@googlegroups.com
Is it currently possible to call mixin and have the attributes passed to the current mixin pass through?

Example:

mixin A()
| #{attributes.x}

mixin B()
+A()

+B()(x="x")


Is there any way to call A from B so that the attribute x goes through?

If not, would this considered for a possible addition? I can probably submit a patch for it relatively quickly.

Forbes Lindesay

unread,
Jul 15, 2014, 7:34:38 PM7/15/14
to jad...@googlegroups.com
Yes, you can do this:

```jade

mixin A()
  | #{attributes.x}

mixin B()
  +A()&attributes(attributes)

+B()(x=“x”)

```

--
You received this message because you are subscribed to the Google Groups "Jade" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jadejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages