In a form I have rows of form-groups with each having a label and form-control element.
<div class="form-group row">
<label class="col-xs-2 col-md-3">Text</label>
<div class="col-xs-10 col-md-9">
<input class="form-control" type="text">
</div>
</div>
Labels use classes: 'col-xs-2 col-md-3' and form-controls: 'col-xs-10 col-md-9'
Is it possible to combine the two 'col' classes of the label element into one class in sass? Something like this:
.label-width{
.col-xs-2
.col-md-3
}
Giving me:
<label class="label-width">Text</label>
Which then I could control with a sass variable such as: '$labelColumnWidth: 2' to give me a quick way to set label widths for all rows. Something like this:
$labelColumnWidth: 2
.label-width{
.col-xs-#{$labelColumnWidth}
.col-md-#{$labelColumnWidth}
}
I would like to use the bootstrap classes for column spacing but able to control them with sass variables to quickly change the layout of the form. Possible?