New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support blocks with mixins #310
Comments
I'll have to revisit this when I implement blocks for template inheritance (if/when), I dont mind the idea, though I think template inheritance will get around a lot of this, I suppose then a template would essentially be a mixin, so maybe if we make that abstraction they can both act the same with some behaviour like this |
Thanks for the ack. I've used template inheritance in Jinja a little, and while it's nice for the top level layouts, I think blocks in mixins will be more useful for "widget" type abstractions where composition works better. Jinja enables something like this with call support in macros but it's limited to one block (without doing some tricky/ugly things). I'll welcome blocks either way though :) |
yeah true, they kinda compliment each other, definitely something we can play around with a bit. I'd like to get the mixins more powerful like Stylus mixins |
yeah this would be really nice. |
👍 Another use case:
|
Yeah, this would pretty much be the holy grail for me. |
This would be hugely useful IMO. Tonnes of use cases can be handled by this pattern (that are otherwise not possible) in the context of ui containers/widgets etc. |
it's almost like a shadow dom haha |
(All this markup comes from: http://vanyarose.com/works/at-the-bottom-of-the-hill) I think Jade needs to approach a mashup of (Note the following is markup for a "panel", one of many)
Here is another panel:
So I want to be able to invoke multiple Without the ability for a
|
It would be pretty awesome to have support for blocks in mixins. There are some simple use cases which would be a great start:
It would be even more powerful if blocks could also be passed context and used along with iteration. This could enable some powerful UI abstractions that hide repetitive detail:
The text was updated successfully, but these errors were encountered: