2

How can I add if/else statement to mixin for adding checked attribute to my first radio input?

mixin tab-header(name, id)
  input(type='radio' name='tabs' id=id checked)
  label(for=id) name
+tab-header('Monday', 'toggle-monday')
+tab-header('Tuesday', 'toggle-tuesday')
+tab-header('Wednesday', 'toggle-wednesday')
+tab-header('Thursday', 'toggle-thursday')
Entry Guy
  • 425
  • 1
  • 7
  • 18

1 Answers1

1

Just add one more parameter:

mixin tab-header(name, id, checked)
  input(type='radio' name='tabs' id=id checked=checked)
  label(for=id) name

+tab-header('Monday', 'toggle-monday', true)