tagInput.scss 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. @import "./animation.scss";
  2. @import "./variables.scss";
  3. $module: #{$prefix}-tagInput;
  4. .#{$module} {
  5. background-color: $color-tagInput_default-bg-default;
  6. border: $width-tagInput-border-default $color-tagInput-border-default solid;
  7. border-radius: $radius-tagInput;
  8. display: inline-flex;
  9. font-weight: $font-weight-regular;
  10. width: 100%;
  11. box-sizing: border-box;
  12. transition: background-color $transition_duration-tagInput-bg $transition_function-tagInput-bg $transition_delay-tagInput-bg,
  13. border $transition_duration-tagInput-border $transition_function-tagInput-border $transition_delay-tagInput-border;
  14. &-drag {
  15. &-item {
  16. display: flex;
  17. align-items: center;
  18. &-move {
  19. z-index: $z-tagInput_drag_item_move;
  20. }
  21. }
  22. &-handler {
  23. color: $color-tagInput_handler-icon-default;
  24. margin-right: $spacing-tagInput_drag_handler-marginRight;
  25. cursor: move;
  26. }
  27. }
  28. &-hover {
  29. background-color: $color-tagInput_default-bg-hover;
  30. border: $width-tagInput-border-hover $color-tagInput-border-hover solid;
  31. }
  32. &-focus {
  33. background-color: $color-tagInput_default-bg-focus;
  34. border: $width-tagInput-border-focus $color-tagInput-border-focus solid;
  35. }
  36. &-warning {
  37. background-color: $color-tagInput_warning-bg-default;
  38. border-color: $color-tagInput_warning-border-default;
  39. &:hover {
  40. background-color: $color-tagInput_warning-bg-hover;
  41. border-color: $color-tagInput_warning-border-hover;
  42. }
  43. &.#{$module}-focus {
  44. background-color: $color-tagInput_warning-bg-focus;
  45. border-color: $color-tagInput_warning-border-focus;
  46. }
  47. }
  48. &-error {
  49. background-color: $color-tagInput_danger-bg-default;
  50. border-color: $color-tagInput_danger-border-default;
  51. &:hover {
  52. background-color: $color-tagInput_danger-bg-hover;
  53. border-color: $color-tagInput_danger-border-hover;
  54. }
  55. &.#{$module}-focus {
  56. background-color: $color-tagInput_danger-bg-focus;
  57. border-color: $color-tagInput_danger-border-focus;
  58. }
  59. }
  60. &-disabled {
  61. cursor: not-allowed;
  62. .#{$module}-clearBtn,
  63. .#{$module}-prefix,
  64. .#{$module}-suffix {
  65. color: $color-tagInput_disabled-text-default;
  66. }
  67. .#{$module}-wrapper {
  68. cursor: not-allowed;
  69. }
  70. .#{$module}-wrapper-tag {
  71. color: $color-tagInput_disabled-text-default;
  72. background-color: transparent;
  73. }
  74. .#{$module}-wrapper-input {
  75. cursor: not-allowed;
  76. &::placeholder {
  77. color: $color-tagInput_disabled-text-default;
  78. }
  79. }
  80. }
  81. &-wrapper {
  82. display: flex;
  83. flex-wrap: wrap;
  84. flex-grow: 1;
  85. align-items: center;
  86. padding-left: $spacing-extra-tight;
  87. padding-right: $spacing-extra-tight;
  88. overflow: hidden;
  89. &-small {
  90. min-height: $height-tagInput-small;
  91. }
  92. &-default {
  93. min-height: $height-tagInput-default;
  94. }
  95. &-large {
  96. min-height: $height-tagInput-large;
  97. }
  98. &-tag {
  99. margin-right: $spacing-extra-tight;
  100. white-space: pre;
  101. &-size {
  102. &-small {
  103. margin-top: $spacing-tagInput_small-Y;
  104. margin-bottom: $spacing-tagInput_small-Y;
  105. }
  106. &-default {
  107. margin-top: $spacing-tagInput_default-Y;
  108. margin-bottom: $spacing-tagInput_default-Y;
  109. }
  110. &-large {
  111. margin-top: $spacing-tagInput_large-Y;
  112. margin-bottom: $spacing-tagInput_large-Y;
  113. }
  114. }
  115. &-icon {
  116. padding-left: $spacing-tagInput_tag_icon_paddingLeft;
  117. }
  118. }
  119. &-typo {
  120. font-size: $font-size-small;
  121. &-disabled {
  122. color: $color-tagInput_disabled-text-default;
  123. }
  124. }
  125. &-n {
  126. cursor: pointer;
  127. font-size: $font-size-small;
  128. margin-right: $spacing-extra-tight;
  129. color: var(--semi-color-text-0);
  130. padding-left: $spacing-tagInput_wrapper_n_paddingX;
  131. padding-right: $spacing-tagInput_wrapper_n_paddingX;
  132. &-disabled {
  133. cursor: not-allowed;
  134. color: $color-tagInput_disabled-text-default;
  135. }
  136. }
  137. & &-input {
  138. flex-grow: 1;
  139. width: min-content;
  140. min-width: 38px;
  141. border: none;
  142. outline: none;
  143. background-color: transparent;
  144. font-size: $font-size-regular;
  145. &:hover {
  146. background-color: transparent;
  147. }
  148. &:not(:first-child) > input {
  149. padding-left: 0;
  150. }
  151. &-small {
  152. height: $height-tagInput_input_small;
  153. margin-top: $spacing-tagInput_small-Y;
  154. margin-bottom: $spacing-tagInput_small-Y;
  155. line-height: $height-tagInput_input_small;
  156. & .#{$prefix}-input-small {
  157. height: $height-tagInput_input_small;
  158. line-height: $height-tagInput_input_small;
  159. }
  160. }
  161. &-default {
  162. height: $height-tagInput_input_default;
  163. margin-top: $spacing-tagInput_default-Y;
  164. margin-bottom: $spacing-tagInput_default-Y;
  165. line-height: $height-tagInput_input_default;
  166. & .#{$prefix}-input-default {
  167. height: $height-tagInput_input_default;
  168. line-height: $height-tagInput_input_default;
  169. }
  170. }
  171. &-large {
  172. height: $height-tagInput_input_large;
  173. margin-top: $spacing-tagInput_large-Y;
  174. margin-bottom: $spacing-tagInput_large-Y;
  175. line-height: $height-tagInput_input_large;
  176. & .#{$prefix}-input-large {
  177. height: $height-tagInput_input_large;
  178. line-height: $height-tagInput_input_large;
  179. }
  180. }
  181. }
  182. }
  183. &-clearBtn {
  184. @include all-center;
  185. width: $width-tagInput-clear-medium;
  186. flex-shrink: 0;
  187. color: $color-tagInput-icon-default;
  188. &:hover {
  189. cursor: pointer;
  190. color: $color-tagInput-icon-hover;
  191. }
  192. &-invisible {
  193. visibility: hidden;
  194. }
  195. }
  196. &-prefix,
  197. &-suffix {
  198. @include all-center;
  199. &-text {
  200. margin: 0 $spacing-base-tight;
  201. font-weight: 600;
  202. white-space: nowrap;
  203. }
  204. &-icon {
  205. color: $color-tagInput-icon-default;
  206. margin: 0 $spacing-tight;
  207. }
  208. }
  209. &-prefix {
  210. &-text {
  211. color: $color-tagInput_prefix-default;
  212. }
  213. }
  214. &-suffix {
  215. &-text {
  216. color: $color-tagInput_suffix-default;
  217. }
  218. }
  219. }
  220. @import "./rtl.scss";