1
0

tagInput.scss 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. @import "./variables.scss";
  2. $module: #{$prefix}-tagInput;
  3. .#{$module} {
  4. background-color: $color-tagInput_default-bg-default;
  5. border: $width-tagInput-border-default $color-tagInput-border-default solid;
  6. border-radius: $radius-tagInput;
  7. display: inline-flex;
  8. font-weight: $font-weight-regular;
  9. width: 100%;
  10. box-sizing: border-box;
  11. transition: background-color $transition_duration-tagInput-bg $transition_function-tagInput-bg $transition_delay-tagInput-bg,
  12. border $transition_duration-tagInput-border $transition_function-tagInput-border $transition_delay-tagInput-border;
  13. &-hover {
  14. background-color: $color-tagInput_default-bg-hover;
  15. border: $width-tagInput-border-hover $color-tagInput-border-hover solid;
  16. }
  17. &-focus {
  18. background-color: $color-tagInput_default-bg-focus;
  19. border: $width-tagInput-border-focus $color-tagInput-border-focus solid;
  20. }
  21. &-warning {
  22. background-color: $color-tagInput_warning-bg-default;
  23. border-color: $color-tagInput_warning-border-default;
  24. &:hover {
  25. background-color: $color-tagInput_warning-bg-hover;
  26. border-color: $color-tagInput_warning-border-hover;
  27. }
  28. &.#{$module}-focus {
  29. background-color: $color-tagInput_warning-bg-focus;
  30. border-color: $color-tagInput_warning-border-focus;
  31. }
  32. }
  33. &-error {
  34. background-color: $color-tagInput_danger-bg-default;
  35. border-color: $color-tagInput_danger-border-default;
  36. &:hover {
  37. background-color: $color-tagInput_danger-bg-hover;
  38. border-color: $color-tagInput_danger-border-hover;
  39. }
  40. &.#{$module}-focus {
  41. background-color: $color-tagInput_danger-bg-focus;
  42. border-color: $color-tagInput_danger-border-focus;
  43. }
  44. }
  45. &-disabled {
  46. cursor: not-allowed;
  47. .#{$module}-clearBtn,
  48. .#{$module}-prefix,
  49. .#{$module}-suffix {
  50. color: $color-tagInput_disabled-text-default;
  51. }
  52. .#{$module}-wrapper {
  53. cursor: not-allowed;
  54. }
  55. .#{$module}-wrapper-tag {
  56. color: $color-tagInput_disabled-text-default;
  57. background-color: transparent;
  58. }
  59. .#{$module}-wrapper-input {
  60. cursor: not-allowed;
  61. &::placeholder {
  62. color: $color-tagInput_disabled-text-default;
  63. }
  64. }
  65. }
  66. &-wrapper {
  67. display: flex;
  68. flex-wrap: wrap;
  69. flex-grow: 1;
  70. align-items: center;
  71. padding-left: $spacing-extra-tight;
  72. padding-right: $spacing-extra-tight;
  73. overflow: hidden;
  74. &-tag {
  75. margin-right: $spacing-extra-tight;
  76. white-space: pre;
  77. &-size {
  78. &-small {
  79. margin-top: $spacing-tagInput_small-Y;
  80. margin-bottom: $spacing-tagInput_small-Y;
  81. }
  82. &-default {
  83. margin-top: $spacing-tagInput_default-Y;
  84. margin-bottom: $spacing-tagInput_default-Y;
  85. }
  86. &-large {
  87. margin-top: $spacing-tagInput_large-Y;
  88. margin-bottom: $spacing-tagInput_large-Y;
  89. }
  90. }
  91. }
  92. &-typo {
  93. font-size: $font-size-small;
  94. &-disabled {
  95. color: $color-tagInput_disabled-text-default;
  96. }
  97. }
  98. &-n {
  99. cursor: pointer;
  100. font-size: $font-size-small;
  101. margin-right: $spacing-extra-tight;
  102. color: var(--semi-color-text-0);
  103. padding-left: $spacing-tagInput_wrapper_n_paddingX;
  104. padding-right: $spacing-tagInput_wrapper_n_paddingX;
  105. &-disabled {
  106. cursor: not-allowed;
  107. color: $color-tagInput_disabled-text-default;
  108. }
  109. }
  110. & &-input {
  111. flex-grow: 1;
  112. width: min-content;
  113. min-width: 38px;
  114. border: none;
  115. outline: none;
  116. background-color: transparent;
  117. font-size: $font-size-regular;
  118. &:hover {
  119. background-color: transparent;
  120. }
  121. &:not(:first-child) > input {
  122. padding-left: 0;
  123. }
  124. }
  125. }
  126. &-clearBtn {
  127. @include all-center;
  128. width: $width-tagInput-clear-medium;
  129. flex-shrink: 0;
  130. color: $color-tagInput-icon-default;
  131. &:hover {
  132. cursor: pointer;
  133. color: $color-tagInput-icon-hover;
  134. }
  135. &-invisible {
  136. visibility: hidden;
  137. }
  138. }
  139. &-prefix,
  140. &-suffix {
  141. @include all-center;
  142. &-text {
  143. margin: 0 $spacing-base-tight;
  144. font-weight: 600;
  145. white-space: nowrap;
  146. }
  147. &-icon {
  148. color: $color-tagInput-icon-default;
  149. margin: 0 $spacing-tight;
  150. }
  151. }
  152. &-prefix {
  153. &-text {
  154. color: $color-tagInput_prefix-default;
  155. }
  156. }
  157. &-suffix {
  158. &-text {
  159. color: $color-tagInput_suffix-default;
  160. }
  161. }
  162. }
  163. @import "./rtl.scss";