Skip to content

Instantly share code, notes, and snippets.

@gjain574
Created July 16, 2020 11:25
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 gjain574/535326186b5509624c6da6aa802c3daa to your computer and use it in GitHub Desktop.
Save gjain574/535326186b5509624c6da6aa802c3daa to your computer and use it in GitHub Desktop.
{% macro CustomInput(label) %}
<div class="form-group">
<label class="abc-c-form__label" for="">{{ label }}</label>
<input class="abc-c-form__controller form-control" type="input">
</div>
{% endmacro %}
{% macro CustomInput(label, additional_classes) %}
<div class="form-group">
<label class="abc-c-form__label" for="">{{ label }}</label>
<input class="abc-c-form__controller form-control {{ additional_classes|join(" ") }}" type="input">
</div>
{% endmacro %}
{% macro CustomInput(label, additional_classes, attrs) %}
<div class="form-group">
{% set attributes = '' %}
{% for key, attr in attrs %}
{% set attributes = attributes ~ key ~ '=' ~ attr ~ ' ' %}
{% endfor %}
<label class="abc-c-form__label" for="">{{ label }}</label>
<input class="abc-c-form__controller form-control {{ additional_classes|join(" ") }}" type="input" {{attributes}} >
</div>
{% endmacro %}
{{ CustomInput("Custom Label") }}
{{ CustomInput("Custom Label", ["datepicker", "d-block"]) }}
{% set attrs =
{
"placeholder" : "Custom Input Goes Here",
"id" : "12",
"style" : "padding-top:10px;"
}
%}
{{ CustomInput("Custom Label", ["datepicker", "d-block"], attrs) }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment