pug-bootstrap/PUG-Bootstrap

Forms input label

elmahdim opened this issue · 1 comments

In components/forms.jade there's 2 options for input:

  1. Input control with form-group wrapper
  2. Simple form input control without a form-group

Most of the time I don't need to implement label in my forms. So it would be perfect to have an extra mixin without label, like so:

//- Input control with form-group wrapper
//- Modified: renamed from input > input-label
mixin input-label(type,id,placeholder,label,name)

//- Input control without label
//- New
mixin input(type,id,placeholder,name)
    .form-group
        input.form-control(type="#{type}",id="#{id}",placeholder="#{placeholder}",name="#{name}")

//- Simple form input control without a form-group
mixin input-simple(type,id,placeholder)

Usage

+input-label(...)
+input-simple(...)
+input(...)

Cheers

Renaming an existing mixin will break a lot of stuff, so i suggest to go with input-simple mixin.
We have added the name attribute to the same which was missing earlier in the latest version