Permalink
Browse files

feat(form-group): new label-size prop

Allow optionally control of the label's size to match the form input(s) size
  • Loading branch information...
tmorehouse committed Nov 29, 2017
1 parent a711037 commit b8311e5c6842b3eeeb44e0d898876cdcc6cdab9e
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/components/form-group/_form-group.js
@@ -129,6 +129,10 @@ export default {
type: String,
default: null
},
labelSize: {
type: String,
default: null
},
labelSrOnly: {
type: Boolean,
default: false
@@ -173,9 +177,10 @@ export default {
},
labelClasses () {
return [
this.labelSrOnly ? 'sr-only' : 'col-form-legend',
this.labelSrOnly ? 'sr-only' : 'col-form-label',
this.labelLayout,
this.labelAlignClass,
this.labelSizeClass,
this.labelClass
]
},
@@ -191,6 +196,12 @@ export default {
}
return this.labelTextAlign ? `text-${this.labelTextAlign}` : null
},
labelSizeClass () {
if (this.labelSrOnly) {
return null
}
return this.labelSize ? `col-form-label-${this.labelSize}` : null
},
inputLayoutClasses () {
return [
this.horizontal ? `col-${this.breakpoint}-${12 - this.labelCols}` : 'col-12'

0 comments on commit b8311e5

Please sign in to comment.