tagInput.scss 8.4 KB

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