Answer the question
In order to leave comments, you need to log in
Pug mixin in a mixin?
Hello comrades.
For a complete picture, we need a little imagination, imagine a section with some three identical (size and general essence) tile blocks, each with a different picture, different heading and text.
Since blocks are repetitive, I wanted to create a mixin, something like mixin item(). Since the content in each is different, I thought it was to put inside a mixin with different parameters and attributes, and the output turned out:
mixin item()
mixin item_img(src, alt)
img(src=src, alt=alt)
mixin item_title(title)
h4= title
mixin item_text(text)
p= text
+item
+item_img(src, alt)
+item_title(’Title’)
+item_text(’Text')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question