tagInput.scss 5.0 KB

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