|
| 1 | +@use '../../style-var/index.scss' as *; |
| 2 | + |
| 3 | +.#{$cls-prefix}-input { |
| 4 | + display: flex; |
| 5 | + align-items: center; |
| 6 | + width: 100%; |
| 7 | + box-sizing: border-box; |
| 8 | + background-color: $ccui-base-bg; |
| 9 | + border: 1px solid $ccui-line; |
| 10 | + border-radius: $ccui-border-radius; |
| 11 | + color: $ccui-text; |
| 12 | + font-size: 14px; |
| 13 | + transition: |
| 14 | + border-color $ccui-animation-duration-base, |
| 15 | + box-shadow $ccui-animation-duration-base; |
| 16 | + |
| 17 | + &:hover { |
| 18 | + border-color: $ccui-brand-hover; |
| 19 | + } |
| 20 | + |
| 21 | + &:focus-within { |
| 22 | + border-color: $ccui-brand; |
| 23 | + box-shadow: 0 0 0 2px rgba($ccui-brand, 0.2); |
| 24 | + } |
| 25 | + |
| 26 | + &--disabled { |
| 27 | + background-color: $ccui-disabled-bg; |
| 28 | + border-color: $ccui-disabled-line; |
| 29 | + color: $ccui-disabled-text; |
| 30 | + cursor: not-allowed; |
| 31 | + |
| 32 | + &:hover { |
| 33 | + border-color: $ccui-disabled-line; |
| 34 | + } |
| 35 | + } |
| 36 | + |
| 37 | + &--large { |
| 38 | + height: $ccui-size-lg; |
| 39 | + font-size: $ccui-font-size-lg; |
| 40 | + |
| 41 | + &.#{$cls-prefix}-input--prefix { |
| 42 | + .#{$cls-prefix}-input__inner { |
| 43 | + padding-left: 24px; |
| 44 | + } |
| 45 | + } |
| 46 | + |
| 47 | + &.#{$cls-prefix}-input--suffix, |
| 48 | + &.#{$cls-prefix}-input--clearable { |
| 49 | + .#{$cls-prefix}-input__inner { |
| 50 | + padding-right: 24px; |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | + &--default { |
| 56 | + height: $ccui-size-md; |
| 57 | + font-size: $ccui-font-size-md; |
| 58 | + |
| 59 | + &.#{$cls-prefix}-input--prefix { |
| 60 | + .#{$cls-prefix}-input__inner { |
| 61 | + padding-left: 24px; |
| 62 | + } |
| 63 | + } |
| 64 | + |
| 65 | + &.#{$cls-prefix}-input--suffix, |
| 66 | + &.#{$cls-prefix}-input--clearable { |
| 67 | + .#{$cls-prefix}-input__inner { |
| 68 | + padding-right: 24px; |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + &--small { |
| 74 | + height: $ccui-size-sm; |
| 75 | + font-size: $ccui-font-size-sm; |
| 76 | + |
| 77 | + &.#{$cls-prefix}-input--prefix { |
| 78 | + .#{$cls-prefix}-input__inner { |
| 79 | + padding-left: 20px; |
| 80 | + } |
| 81 | + } |
| 82 | + |
| 83 | + &.#{$cls-prefix}-input--suffix, |
| 84 | + &.#{$cls-prefix}-input--clearable { |
| 85 | + .#{$cls-prefix}-input__inner { |
| 86 | + padding-right: 20px; |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + |
| 91 | + &__wrapper { |
| 92 | + position: relative; |
| 93 | + width: 100%; |
| 94 | + padding: 0 8px; |
| 95 | + } |
| 96 | + |
| 97 | + &__prepend, |
| 98 | + &__append { |
| 99 | + display: flex; |
| 100 | + align-items: center; |
| 101 | + white-space: nowrap; |
| 102 | + background-color: $ccui-area; |
| 103 | + color: $ccui-text; |
| 104 | + font-size: inherit; |
| 105 | + line-height: 1; |
| 106 | + height: 100%; |
| 107 | + padding: 0 10px; |
| 108 | + } |
| 109 | + |
| 110 | + &__prepend { |
| 111 | + border-radius: $ccui-border-radius 0 0 $ccui-border-radius; |
| 112 | + border-right: 1px solid $ccui-line; |
| 113 | + } |
| 114 | + |
| 115 | + &__append { |
| 116 | + border-radius: 0 $ccui-border-radius $ccui-border-radius 0; |
| 117 | + border-left: 1px solid $ccui-line; |
| 118 | + } |
| 119 | + |
| 120 | + &__inner { |
| 121 | + width: 100%; |
| 122 | + height: 100%; |
| 123 | + background: transparent; |
| 124 | + border: none; |
| 125 | + outline: none; |
| 126 | + color: inherit; |
| 127 | + font-size: inherit; |
| 128 | + font-family: inherit; |
| 129 | + position: relative; |
| 130 | + z-index: 0; |
| 131 | + box-sizing: border-box; |
| 132 | + padding: 4px 0; |
| 133 | + |
| 134 | + &::placeholder { |
| 135 | + color: $ccui-placeholder; |
| 136 | + } |
| 137 | + |
| 138 | + &:disabled { |
| 139 | + cursor: not-allowed; |
| 140 | + color: $ccui-disabled-text; |
| 141 | + } |
| 142 | + } |
| 143 | + |
| 144 | + &__prefix, |
| 145 | + &__suffix { |
| 146 | + position: absolute; |
| 147 | + top: 0; |
| 148 | + bottom: 0; |
| 149 | + display: flex; |
| 150 | + align-items: center; |
| 151 | + justify-content: center; |
| 152 | + color: $ccui-placeholder; |
| 153 | + pointer-events: none; |
| 154 | + z-index: 1; |
| 155 | + } |
| 156 | + |
| 157 | + &__prefix { |
| 158 | + left: 8px; |
| 159 | + } |
| 160 | + |
| 161 | + &__suffix { |
| 162 | + right: 8px; |
| 163 | + } |
| 164 | + |
| 165 | + &__clear, |
| 166 | + &__password-visible, |
| 167 | + &__password-hidden { |
| 168 | + cursor: pointer; |
| 169 | + pointer-events: auto; |
| 170 | + color: $ccui-placeholder; |
| 171 | + transition: color $ccui-animation-duration-base; |
| 172 | + |
| 173 | + &:hover { |
| 174 | + color: $ccui-text; |
| 175 | + } |
| 176 | + } |
| 177 | +} |
0 commit comments