pug-bootstrap / PUG-Bootstrap

Bootstrap framework written completely using mixins in Pug
http://pug-bootstrap.github.io/PUG-Bootstrap/
MIT License
226 stars 73 forks source link

Forms input label #21

Closed elmahdim closed 7 years ago

elmahdim commented 7 years ago

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

rajasegar commented 7 years ago

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