tag.scss 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. //@import '../theme/variables.scss';
  2. @import "./variables.scss";
  3. @import "./mixin.scss";
  4. $module: #{$prefix}-tag;
  5. $colors: "amber", "blue", "cyan", "green", "grey", "indigo", "light-blue", "light-green", "lime", "orange", "pink",
  6. "purple", "red", "teal", "violet", "yellow";
  7. $types: "ghost", "solid", "light";
  8. .#{$module} {
  9. box-sizing: border-box;
  10. display: inline-block;
  11. border-radius: $radius-tag;
  12. background-color: transparent;
  13. position: relative;
  14. user-select: none;
  15. // hidden avatar tag image
  16. overflow: hidden;
  17. white-space: nowrap;
  18. vertical-align: bottom;
  19. &-default,
  20. &-small {
  21. @include font-size-small;
  22. height: $height-tag_small;
  23. padding: $spacing-tag_small-paddingY $spacing-tag_small-paddingX;
  24. &:focus-visible {
  25. outline: $width-tag-outline solid $color-tag-outline-focus;
  26. }
  27. }
  28. &-square {
  29. border-radius: $radius-tag;
  30. }
  31. &-circle {
  32. border-radius: $radius-tag_circle;
  33. }
  34. &-large {
  35. @include font-size-small;
  36. padding: $spacing-tag_large-paddingY $spacing-tag_large-paddingX;
  37. height: $height-tag_large;
  38. &:focus-visible {
  39. outline: $width-tag-outline solid $color-tag-outline-focus;
  40. }
  41. }
  42. &-invisible {
  43. display: none;
  44. }
  45. &-content {
  46. display: flex;
  47. @include all-center;
  48. height: 100%;
  49. }
  50. &-close {
  51. @include all-center;
  52. color: $color-tag_close-icon-default;
  53. padding-left: $spacing-tag_close-paddingLeft;
  54. cursor: pointer;
  55. }
  56. &-closable {
  57. padding: $spacing-tag_closable-paddingTop $spacing-tag_closable-paddingRight $spacing-tag_closable-paddingBottom
  58. $spacing-tag_closable-paddingLeft;
  59. }
  60. &-avatar-square,
  61. &-avatar-circle {
  62. .#{$prefix}-avatar {
  63. margin-right: $spacing-tag_avatar-marginRight;
  64. }
  65. }
  66. &-avatar-square {
  67. padding: $spacing-tag_avatar_square-paddingTop $spacing-tag_avatar_square-paddingRight
  68. $spacing-tag_avatar_square-paddingBottom $spacing-tag_avatar_square-paddingLeft;
  69. .#{$prefix}-avatar {
  70. & > img {
  71. background-color: $color-tag_avatar_square_img-bg-default;
  72. }
  73. }
  74. }
  75. &-avatar-circle {
  76. padding: $spacing-tag_avatar_circle-paddingTop $spacing-tag_avatar_circle-paddingRight
  77. $spacing-tag_avatar_circle-paddingBottom $spacing-tag_avatar_circle-paddingLeft;
  78. }
  79. &-avatar-square.#{$module}-default,
  80. &-avatar-square.#{$module}-small {
  81. .#{$prefix}-avatar {
  82. width: $height-tag_small;
  83. height: $height-tag_small;
  84. }
  85. }
  86. &-avatar-square.#{$module}-large {
  87. .#{$prefix}-avatar {
  88. width: $height-tag_large;
  89. height: $height-tag_large;
  90. }
  91. }
  92. &-avatar-circle.#{$module}-small,
  93. &-avatar-circle.#{$module}-default {
  94. // when avatarShape=circle change tag border radius
  95. border-radius: $height-tag_small * 0.5 + 1;
  96. .#{$prefix}-avatar {
  97. width: $width-tag_avatar_circle_small;
  98. height: $width-tag_avatar_circle_small;
  99. }
  100. }
  101. &-avatar-circle.#{$module}-large {
  102. border-radius: $height-tag_large * 0.5 + 1;
  103. .#{$prefix}-avatar {
  104. width: $width-tag_avatar_circle_large;
  105. height: $width-tag_avatar_circle_large;
  106. }
  107. }
  108. }
  109. .#{$module}-group {
  110. display: block;
  111. .#{$module} {
  112. margin-bottom: $spacing-tag_group-marginBottom;
  113. margin-right: $spacing-tag_group-marginRight;
  114. }
  115. height: auto;
  116. &-max.#{$module}-group-small {
  117. height: ($height-tag_small + 2);
  118. }
  119. &-max.#{$module}-group-large {
  120. height: ($height-tag_large + 2);
  121. }
  122. // &-small {
  123. // height: ($height-tag_small + 2);
  124. // }
  125. // &-large {
  126. // height: ($height-tag_large + 2);
  127. // }
  128. }
  129. .#{$module}-rest-group-popover {
  130. .#{$module} {
  131. margin-right: $spacing-tag_group-marginRight;
  132. margin-bottom: $spacing-tag_group-marginBottom;
  133. &:last-of-type {
  134. margin-right: 0;
  135. }
  136. }
  137. }
  138. @each $c in $colors {
  139. @each $t in $types {
  140. .#{$module}-#{$c}-#{$t} {
  141. @include tag-style($c, $t);
  142. }
  143. }
  144. }
  145. @each $t in $types {
  146. .#{$module}-white-#{$t} {
  147. background-color: $color-tag_white-bg-default;
  148. border: $width-tag-border solid $color-tag_white-border-default;
  149. color: $color-tag_white-text-default;
  150. // .#{$module}-close {
  151. // color: $tag-color-white-default-icon;
  152. // }
  153. }
  154. }
  155. .#{$module}-white-ghost,
  156. .#{$module}-white-light,
  157. .#{$module}-white-solid {
  158. .#{$module}-close {
  159. color: $color-tag_white-icon-default;
  160. }
  161. }
  162. .#{$module}-avatar-square,
  163. .#{$module}-avatar-circle {
  164. background-color: $color-tag_avatar-bg-default;
  165. border: $width-tag_avatar-border solid $color-tag_avatar-border-default;
  166. color: $color-tag_avatar-text-default;
  167. }
  168. .#{$module}-solid {
  169. .#{$module}-close {
  170. color: $color-tag_close-icon_deep-default;
  171. }
  172. }
  173. @import './rtl.scss';