badge.scss 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. @import "./variables.scss";
  2. $module: #{$prefix}-badge;
  3. .#{$module} {
  4. position: relative;
  5. display: inline-block;
  6. &-dot {
  7. box-sizing: border-box;
  8. width: $width-badge_dot;
  9. height: $height-badge_dot;
  10. border-radius: $radius-badge_dot;
  11. background-color: $color-badge_default-bg-default;
  12. border: $width-badge-border $color-badge_default-border-default solid;
  13. z-index: $z-badge;
  14. }
  15. &-count {
  16. box-sizing: border-box;
  17. height: $height-badge_count;
  18. min-width: $height-badge_count;
  19. border-radius: $height-badge_count * 0.5;
  20. padding: $spacing-badge_count-paddingY $spacing-badge_count-paddingX;
  21. background-color: $color-badge_default-bg-default;
  22. border: $width-badge-border $color-badge_default-border-default solid;
  23. z-index: $z-badge;
  24. text-align: center;
  25. @include font-size-small;
  26. font-weight: $font-size-regular;
  27. color: $color-badge_default-text-default;
  28. }
  29. &-rightTop {
  30. position: absolute;
  31. top: 0;
  32. right: 0;
  33. transform: translate(50%, -50%);
  34. transform-origin: 100% 0%;
  35. }
  36. &-rightBottom {
  37. position: absolute;
  38. right: 0;
  39. bottom: 0;
  40. transform: translate(50%, 50%);
  41. transform-origin: 100% 0%;
  42. }
  43. &-leftTop {
  44. position: absolute;
  45. top: 0;
  46. left: 0;
  47. transform: translate(-50%, -50%);
  48. transform-origin: 100% 0%;
  49. }
  50. &-leftBottom {
  51. position: absolute;
  52. bottom: 0;
  53. left: 0;
  54. transform: translate(-50%, 50%);
  55. transform-origin: 100% 0%;
  56. }
  57. &-custom {
  58. display: flex;
  59. }
  60. &-block {
  61. position: static;
  62. display: inline-block;
  63. }
  64. &-light::before {
  65. content: "";
  66. display: block;
  67. width: 100%;
  68. height: 100%;
  69. border-radius: inherit;
  70. position: absolute;
  71. top: 0;
  72. left: 0;
  73. background-color: $color-badge_default_light-bg-default;
  74. z-index: $z-badge_light-bg;
  75. }
  76. &-light::after {
  77. content: "";
  78. display: block;
  79. width: 100%;
  80. height: 100%;
  81. border-radius: inherit;
  82. position: absolute;
  83. top: 0;
  84. left: 0;
  85. background-color: inherit;
  86. z-index: $z-badge_light-bg;
  87. }
  88. &-primary {
  89. &.#{$module}-solid {
  90. background-color: $color-badge_primary_solid-bg-default;
  91. }
  92. &.#{$module}-light {
  93. background-color: $color-badge_primary_light-bg-default;
  94. color: $color-badge_primary_light-text-default;
  95. }
  96. &.#{$module}-inverted {
  97. color: $color-badge_primary_inverted-text-default;
  98. }
  99. }
  100. &-secondary {
  101. &.#{$module}-solid {
  102. background-color: $color-badge_secondary_solid-bg-default;
  103. }
  104. &.#{$module}-light {
  105. background-color: $color-badge_secondary_light-bg-default;
  106. color: $color-badge_secondary_light-text-default;
  107. }
  108. &.#{$module}-inverted {
  109. color: $color-badge_secondary_inverted-text-default;
  110. }
  111. }
  112. &-tertiary {
  113. &.#{$module}-solid {
  114. background-color: $color-badge_tertiary_solid-bg-default;
  115. }
  116. &.#{$module}-light {
  117. background-color: $color-badge_tertiary_light-bg-default;
  118. color: $color-badge_tertiary_light-text-default;
  119. }
  120. &.#{$module}-inverted {
  121. color: $color-badge_tertiary_inverted-text-default;
  122. }
  123. }
  124. &-danger {
  125. &.#{$module}-solid {
  126. background-color: $color-badge_danger_solid-bg-default;
  127. }
  128. &.#{$module}-light {
  129. background-color: $color-badge_danger_light-bg-default;
  130. color: $color-badge_danger_light-text-default;
  131. }
  132. &.#{$module}-inverted {
  133. color: $color-badge_danger_inverted-text-default;
  134. }
  135. }
  136. &-warning {
  137. &.#{$module}-solid {
  138. background-color: $color-badge_warning_solid-bg-default;
  139. }
  140. &.#{$module}-light {
  141. background-color: $color-badge_warning_light-bg-default;
  142. color: $color-badge_warning_light-text-default;
  143. }
  144. &.#{$module}-inverted {
  145. color: $color-badge_warning_inverted-text-default;
  146. }
  147. }
  148. }
  149. @import "./rtl.scss";