Skip to content

Commit

Permalink
feat(forms): convey status using icon in feedback message to stop rel…
Browse files Browse the repository at this point in the history
…ying on color only, for #249
  • Loading branch information
ffoodd committed Jan 8, 2020
1 parent f4a1b8d commit 95e6f6c
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions scss/mixins/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,26 @@
@include font-size($form-feedback-font-size);
font-weight: $font-weight-bold; // Boosted mod
// color: $color; // Boosted mod

// Boosted mod: status should not rely on color only
@if $enable-validation-icons {
&::before {
display: inline-block;
width: $form-feedback-icon-size;
height: $form-feedback-icon-size;
margin-right: map-get($spacers, 1);
content: "";
background-repeat: no-repeat;
background-size: $form-feedback-icon-size;
}

@if $state == "valid" {
@extend %svg-success;
} @else {
@extend %svg-danger;
}
}
// end mod
}

.#{$state}-tooltip {
Expand Down Expand Up @@ -91,26 +111,6 @@
border-color: $input-focus-border-color;
// box-shadow: 0 0 0 $input-focus-width rgba($color, .25); // Boosted mod, remove box shadow!
}

~ .#{$state}-feedback {
@if $enable-validation-icons {
&::before {
display: inline-block;
width: $form-feedback-icon-size;
height: $form-feedback-icon-size;
margin-right: map-get($spacers, 1);
content: "";
background-repeat: no-repeat;
background-size: $form-feedback-icon-size;
}

@if $state == "valid" {
@extend %svg-success;
} @else {
@extend %svg-danger;
}
}
}
// end mod
}
}
Expand Down

0 comments on commit 95e6f6c

Please sign in to comment.