Skip to content

Instantly share code, notes, and snippets.

@allusis
Last active August 4, 2022 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allusis/cac66662d0af4d5cf991eb36fdcdebc8 to your computer and use it in GitHub Desktop.
Save allusis/cac66662d0af4d5cf991eb36fdcdebc8 to your computer and use it in GitHub Desktop.
Pug Mixin - Input
mixin input(id,name,required)
if required == true
label(for= id)= name
small  (Required)
input(id= id, required)&attributes(attributes)
else
label(for= id)= name
input(id= id, required)&attributes(attributes)
<label for="emailAddress">Email Address<small>&nbsp;(Required)</small></label>
<input class="ma-input" id="emailAddress" required="required" type="email" placeholder="name@domain.com"/>
<label for="phoneNumber">Phone Number</label>
<input class="ma-input" id="phoneNumber" required="required" type="tel" placeholder="(xxx) xxx-xxxx"/>
+input("emailAddress", "Email Address", true)(class="ma-input", type="email", placeholder="name@domain.com")
+input("phoneNumber", "Phone Number", false)(class="ma-input", type="tel", placeholder="(xxx) xxx-xxxx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment