Skip to content

Commit

Permalink
Custom select validation padding fix and additional custom select fee…
Browse files Browse the repository at this point in the history
…dback icon variables
  • Loading branch information
MartijnCuppens authored and XhmikosR committed Oct 23, 2018
1 parent d0b7eb1 commit dd53909
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,10 @@ $custom-select-indicator-color: $gray-800 !default;
$custom-select-indicator: str-replace(url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3e%3cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e"), "#", "%23") !default;
$custom-select-background: $custom-select-indicator no-repeat right $custom-select-padding-x center / $custom-select-bg-size !default; // Used so we can have multiple background elements (e.g., arrow and feedback icon)

$custom-select-feedback-icon-padding-right: $input-height-inner * 3 / 4 + $custom-select-padding-x + $custom-select-indicator-padding !default;
$custom-select-feedback-icon-position: center right ($custom-select-padding-x + $custom-select-indicator-padding) !default;
$custom-select-feedback-icon-size: ($input-height-inner / 2) ($input-height-inner / 2) !default;

$custom-select-border-width: $input-border-width !default;
$custom-select-border-color: $input-border-color !default;
$custom-select-border-radius: $border-radius !default;
Expand Down
10 changes: 3 additions & 7 deletions scss/mixins/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,9 @@
border-color: $color;

@if $enable-validation-icons {
padding-right: $input-height-inner;

@if $state == "valid" {
background: $custom-select-background, $form-feedback-icon-valid no-repeat center right ($input-height-inner * .9) / calc(#{$input-height-inner} / 2) calc(#{$input-height-inner} / 2);
} @else {
background: $custom-select-background, $form-feedback-icon-invalid no-repeat center right ($input-height-inner * .9) / calc(#{$input-height-inner} / 2) calc(#{$input-height-inner} / 2);
}
$form-feedback-icon: if($state == "valid", $form-feedback-icon-valid, $form-feedback-icon-invalid);
padding-right: $custom-select-feedback-icon-padding-right;
background: $custom-select-background, $form-feedback-icon no-repeat $custom-select-feedback-icon-position / $custom-select-feedback-icon-size;
}

&:focus {
Expand Down

0 comments on commit dd53909

Please sign in to comment.