Merge pull request #95 from CartoDB/form-fields-error-state

Adding fields error state
This commit is contained in:
Javier Álvarez Medina 2016-04-18 16:43:23 +02:00
commit de8e49afd0
4 changed files with 28 additions and 12 deletions

View File

@ -13,6 +13,7 @@
@import '../../cdb-variables/sizes'; @import '../../cdb-variables/sizes';
@import '../../cdb-variables/colors'; @import '../../cdb-variables/colors';
@import '../../cdb-utilities/helpers';
.CDB-InputText { .CDB-InputText {
width: 100%; width: 100%;
@ -34,8 +35,10 @@
background: $cThirdBackground; background: $cThirdBackground;
} }
&.has-error { &.has-error {
border: 1px solid rgba($cError, 0.48); @include default-form-error-style();
background: rgba($cError, 0.04);
color: $cError;
} }
} }
.CDB-FieldError .CDB-InputText {
@include default-form-error-style();
}

View File

@ -31,6 +31,7 @@
@import '../../cdb-variables/sizes'; @import '../../cdb-variables/sizes';
@import '../../cdb-variables/colors'; @import '../../cdb-variables/colors';
@import '../../cdb-utilities/helpers';
.CDB-Select { .CDB-Select {
position: relative; position: relative;
@ -64,8 +65,11 @@
background: $cThirdBackground; background: $cThirdBackground;
} }
&.has-error { &.has-error {
border: 1px solid rgba($cError, 0.48); @include default-form-error-style();
background: rgba($cError, 0.04);
color: $cError;
} }
} }
.CDB-FieldError .CDB-Select,
.CDB-FieldError .CDB-SelectFake {
@include default-form-error-style();
}

View File

@ -13,6 +13,7 @@
@import '../../cdb-variables/sizes'; @import '../../cdb-variables/sizes';
@import '../../cdb-variables/colors'; @import '../../cdb-variables/colors';
@import '../../cdb-utilities/helpers';
.CDB-Textarea { .CDB-Textarea {
width: 100%; width: 100%;
@ -35,9 +36,10 @@
border-color: $cSecondaryLine; border-color: $cSecondaryLine;
background: $cThirdBackground; background: $cThirdBackground;
} }
} &:has-error {
.CDB-Textarea.has-error { @include default-form-error-style();
border: 1px solid rgba($cError, 0.48);
background: rgba($cError, 0.04);
color: $cError;
} }
}
.CDB-FieldError .CDB-Textarea {
@include default-form-error-style();
}

View File

@ -93,3 +93,10 @@
display: block !important; display: block !important;
} }
} }
/* helper mixins */
@mixin default-form-error-style() {
border: 1px solid rgba($cError, 0.48);
background: rgba($cError, 0.04);
color: $cError;
}