Phong Duong


Use mixin in Pug

24-07-2020 | #pug

Pug allows you to reuse you elements with mixin. It is like a function, you can pass parameters and use them for attributes or value

mixin pet(name) name
  <li class="pet">cat</li>
  <li class="pet">dog</li>
  <li class="pet">pig</li>

I create a video if you prefer learning by waching

Share: TwitterFacebookLinkedInHacker News