Last active
August 4, 2022 06:46
-
-
Save allusis/cac66662d0af4d5cf991eb36fdcdebc8 to your computer and use it in GitHub Desktop.
Pug Mixin - Input
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<label for="emailAddress">Email Address<small> (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"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+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