|
| 1 | +$theme-color: #6200ee; |
| 2 | +$base-color: #ced4da; |
| 3 | +$font-size: 1rem !default; |
| 4 | + |
| 5 | +$font-family-sans-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, |
| 6 | + 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', |
| 7 | + 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji' !default; |
| 8 | +$font-family: $font-family-sans-serif !default; |
| 9 | + |
| 10 | +$line-height: 1.5; |
| 11 | + |
| 12 | +$input-padding-y: 0.375rem; |
| 13 | +$input-padding-x: 0.75rem; |
| 14 | +$input-border-width: 1px; |
| 15 | +$input-border-color: $base-color; |
| 16 | +$input-border-radius: 0; |
| 17 | +$input-transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; |
| 18 | +$input-placeholder-color: #6c757d; |
| 19 | + |
| 20 | +$input-error-color: #dc3545; |
| 21 | + |
| 22 | +.form-group { |
| 23 | + position: relative; |
| 24 | + margin-top: 35px; |
| 25 | + margin-bottom: 20px; |
| 26 | + |
| 27 | + .form-label { |
| 28 | + position: absolute; |
| 29 | + left: 0; |
| 30 | + top: 7px; |
| 31 | + font-size: 16px; |
| 32 | + pointer-events: none; |
| 33 | + color: $base-color; |
| 34 | + transition: 0.2s ease all; |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +.form-control { |
| 39 | + width: 100%; |
| 40 | + padding: $input-padding-y $input-padding-x; |
| 41 | + font-family: $font-family; |
| 42 | + font-size: $font-size; |
| 43 | + height: calc( |
| 44 | + #{$line-height * 1em} + #{$input-padding-y * 2} + #{$input-border-width * 2} |
| 45 | + ); |
| 46 | + border: 0; |
| 47 | + border-bottom: $input-border-width solid $input-border-color; |
| 48 | + border-radius: $input-border-radius; |
| 49 | + |
| 50 | + // Placeholder |
| 51 | + &::placeholder { |
| 52 | + color: $input-border-color; |
| 53 | + opacity: 1; |
| 54 | + } |
| 55 | + |
| 56 | + &:focus { |
| 57 | + outline: none; |
| 58 | + border-bottom: $input-border-width * 2 solid $input-border-color; |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +/* active state */ |
| 63 | +.form-control:focus ~ .form-label, |
| 64 | +.form-control--value ~ .form-label, |
| 65 | +.custom-select ~ .form-label, |
| 66 | +.checkbox-group ~ .form-label, |
| 67 | +.radio-group ~ .form-label, |
| 68 | +.datalist-input--searching ~ .form-label { |
| 69 | + color: $theme-color; |
| 70 | + top: -18px; |
| 71 | + font-size: 12px; |
| 72 | +} |
| 73 | + |
| 74 | +.checkbox-group, |
| 75 | +.radio-group { |
| 76 | + padding-top: 12px; |
| 77 | +} |
| 78 | + |
| 79 | +.form-control:focus { |
| 80 | + border-bottom: 1px solid $theme-color; |
| 81 | +} |
| 82 | + |
| 83 | +.custom-select { |
| 84 | + border-radius: 0; |
| 85 | + background-image: unset; |
| 86 | + border-bottom: 1px solid $theme-color; |
| 87 | + |
| 88 | + &:focus { |
| 89 | + box-shadow: unset; |
| 90 | + } |
| 91 | +} |
| 92 | + |
| 93 | +.datalist-input { |
| 94 | + border-bottom: 1px solid $theme-color; |
| 95 | +} |
| 96 | + |
| 97 | +.custom-checkbox .custom-control-label { |
| 98 | + padding-left: 1rem; |
| 99 | +} |
| 100 | + |
| 101 | +.custom-control-input:focus:not(:checked) ~ .custom-control-label::before { |
| 102 | + border-color: $theme-color; |
| 103 | +} |
| 104 | + |
| 105 | +.custom-control-input:not(:checked) ~ .custom-control-label::before { |
| 106 | + border-color: $theme-color; |
| 107 | +} |
0 commit comments