Form validation and horizontal row update

* changed .row-label to .control-label as used elsewhere already
* changed .formFieldState mixin to .form-field-validation
This commit is contained in:
Mark Otto 2013-05-16 20:17:42 -07:00
parent 55a1416789
commit 1983ca03ec
4 changed files with 12 additions and 12 deletions

View File

@ -1666,12 +1666,12 @@ select:focus:invalid:focus {
margin-top: 15px;
}
.form-horizontal .row-label {
.form-horizontal .control-label {
padding-top: 6px;
}
@media (min-width: 768px) {
.form-horizontal .row-label {
.form-horizontal .control-label {
text-align: right;
}
}

View File

@ -1077,13 +1077,13 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
<p>Use Bootstrap's predefined grid classes to align labels and groups of form controls in a horizontal layout.</p>
<form class="bs-example form-horizontal">
<div class="row">
<label for="inputEmail" class="col col-lg-2 row-label">Email</label>
<label for="inputEmail" class="col col-lg-2 control-label">Email</label>
<div class="col col-lg-10">
<input type="text" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="row">
<label for="" class="col col-lg-2 row-label">Password</label>
<label for="" class="col col-lg-2 control-label">Password</label>
<div class="col col-lg-10">
<input type="password" id="inputPassword" placeholder="Password">
<div class="checkbox">
@ -1100,13 +1100,13 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
{% highlight html %}
<form class="form-horizontal">
<div class="row">
<label for="inputEmail" class="col col-lg-2 row-label">Email</label>
<label for="inputEmail" class="col col-lg-2 control-label">Email</label>
<div class="col col-lg-10">
<input type="text" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="row">
<label for="" class="col col-lg-2 row-label">Password</label>
<label for="" class="col col-lg-2 control-label">Password</label>
<div class="col col-lg-10">
<input type="password" id="inputPassword" placeholder="Password">
<div class="checkbox">

View File

@ -268,15 +268,15 @@ input[type="checkbox"] {
// Warning
.has-warning {
.formFieldState(@state-warning-text, @state-warning-text, @state-warning-bg);
.form-field-validation(@state-warning-text, @state-warning-text, @state-warning-bg);
}
// Error
.has-error {
.formFieldState(@state-danger-text, @state-danger-text, @state-danger-bg);
.form-field-validation(@state-danger-text, @state-danger-text, @state-danger-bg);
}
// Success
.has-success {
.formFieldState(@state-success-text, @state-success-text, @state-success-bg);
.form-field-validation(@state-success-text, @state-success-text, @state-success-bg);
}
// HTML5 invalid states
@ -443,14 +443,14 @@ select:focus:invalid {
.row + .row {
margin-top: 15px;
}
.row-label {
.control-label {
padding-top: 6px;
}
}
// Only right aline form labels here when the columns stop stacking
@media (min-width: 768px) {
.form-horizontal .row-label {
.form-horizontal .control-label {
text-align: right;
}
}

View File

@ -531,7 +531,7 @@
}
// Generate form validation states
.formFieldState(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
.form-field-validation(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
// Color the label text
.control-label {
color: @text-color;