]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Custom select validation padding fix and additional custom select feedback icon variables
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Mon, 22 Oct 2018 18:36:07 +0000 (20:36 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Tue, 23 Oct 2018 02:43:59 +0000 (05:43 +0300)
scss/_variables.scss
scss/mixins/_forms.scss

index 26b2e6953c754869f17a8ff91cb2a62983b1a97e..5be11ae0bc4b93de840ca9f864e6634190f67931 100644 (file)
@@ -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;
index b2f2454bb7cd3bcf7aeff81c89982656acfa94c9..b8eb59d8360ad4c80d099377511a239f464d7bc3 100644 (file)
       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 {