Simplify form validation states while enabling them to be applied to one field at a time.

This commit is contained in:
Mark Otto
2012-12-26 15:57:52 -06:00
parent d0baa99aed
commit dc5c6d6be8
5 changed files with 64 additions and 138 deletions

View File

@@ -342,15 +342,15 @@ input[type="checkbox"] {
// --------------------------
// Warning
.control-group.warning {
.has-warning {
.formFieldState(@state-warning-text, @state-warning-text, @state-warning-background);
}
// Error
.control-group.error {
.has-error {
.formFieldState(@state-error-text, @state-error-text, @state-error-background);
}
// Success
.control-group.success {
.has-success {
.formFieldState(@state-success-text, @state-success-text, @state-success-background);
}
@@ -523,15 +523,23 @@ select:focus:invalid {
// Increase spacing between groups
.control-group {
margin-bottom: @line-height-base / 2;
position: relative;
margin-bottom: @line-height-base;
.clearfix();
input,
select,
textarea,
.uneditable-input {
margin-bottom: 0;
}
}
// Float the labels left
.control-group > .control-label {
float: left;
width: @component-offset-horizontal - 20;
padding-top: 5px;
padding-top: 6px;
text-align: right;
}