Last active
April 11, 2018 06:42
-
-
Save jonathanarbely/6b0396f2181e8d670ba4b65e3ae4629f to your computer and use it in GitHub Desktop.
Pug Mixin Example
This file contains hidden or 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
// _stepper.pug | |
mixin stepper(title, name, val, inactive) | |
p.c-hitlist__label= title | |
if inactive | |
.stepper__wrapper.disabled__wrapper(id=name+'Stepper') | |
// Decrease value (disabled/default) | |
button.stepper__dec(type='button', disabled) | |
img(src=IMG_pfad+'icons/ih-iconset/minus-676767.svg') | |
// Textinput for direct value-manipulation (inactive + predefined value/default) | |
if val | |
input.c-hitlist__input.stepper__input(type='text', placeholder='beliebig', name=name, id=name, value=val, disabled) | |
// Increase value (disabled/default) | |
button.stepper__inc(type='button', disabled) | |
img(src=IMG_pfad+'icons/ih-iconset/plus-676767.svg') | |
include _input-tooltip.pug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment