tagInput.scss 8.5 KB

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