index.wxss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. .wux-badge {
  2. position: relative;
  3. display: inline-block;
  4. line-height: 1;
  5. vertical-align: middle
  6. }
  7. .wux-badge__count {
  8. position: absolute;
  9. transform: translate(50%,-50%);
  10. top: 0;
  11. right: 0;
  12. height: 36rpx;
  13. border-radius: 18rpx;
  14. min-width: 36rpx;
  15. background: #ed3f14;
  16. color: #fff;
  17. line-height: 36rpx;
  18. text-align: center;
  19. padding: 0 10rpx;
  20. font-size: 24rpx;
  21. white-space: nowrap;
  22. transform-origin: 100% 0;
  23. z-index: 10;
  24. box-shadow: 0 0 0 2rpx #fff;
  25. box-sizing: border-box;
  26. text-rendering: optimizeLegibility
  27. }
  28. .wux-badge__dot {
  29. width: 16rpx;
  30. height: 16rpx;
  31. position: absolute;
  32. transform: translate(50%,-50%);
  33. transform-origin: 100% 0;
  34. top: 0;
  35. right: 0;
  36. border-radius: 100%;
  37. background: #ed3f14;
  38. z-index: 10;
  39. box-shadow: 0 0 0 2rpx #fff
  40. }
  41. .wux-badge--position-topLeft .wux-badge__count,
  42. .wux-badge--position-topLeft .wux-badge__dot {
  43. right: 100%
  44. }
  45. .wux-badge--position-bottomRight .wux-badge__count,
  46. .wux-badge--position-bottomRight .wux-badge__dot {
  47. top: 100%
  48. }
  49. .wux-badge--position-bottomLeft .wux-badge__count,
  50. .wux-badge--position-bottomLeft .wux-badge__dot {
  51. top: 100%;
  52. right: 100%
  53. }
  54. .wux-badge--hide-shadow .wux-badge__count,
  55. .wux-badge--hide-shadow .wux-badge__dot {
  56. box-shadow: none!important
  57. }
  58. .wux-badge__status {
  59. line-height: inherit;
  60. vertical-align: baseline
  61. }
  62. .wux-badge__status-dot {
  63. width: 12rpx;
  64. height: 12rpx;
  65. display: inline-block;
  66. border-radius: 50%;
  67. vertical-align: middle;
  68. position: relative;
  69. top: -2rpx
  70. }
  71. .wux-badge__status-dot--success {
  72. background-color: #52c41a
  73. }
  74. .wux-badge__status-dot--processing {
  75. background-color: #1890ff;
  76. position: relative
  77. }
  78. .wux-badge__status-dot--processing::after {
  79. position: absolute;
  80. top: -2rpx;
  81. left: -2rpx;
  82. width: 100%;
  83. height: 100%;
  84. border-radius: 50%;
  85. border: 2rpx solid #1890ff;
  86. content: "";
  87. animation: statusProcessing 1.2s infinite ease-in-out
  88. }
  89. .wux-badge__status-dot--default {
  90. background-color: #d9d9d9
  91. }
  92. .wux-badge__status-dot--error {
  93. background-color: #f5222d
  94. }
  95. .wux-badge__status-dot--warning {
  96. background-color: #faad14
  97. }
  98. .wux-badge__status-text {
  99. display: inline-block;
  100. color: rgba(0,0,0,.65);
  101. font-size: 28rpx;
  102. margin-left: 16rpx
  103. }
  104. @keyframes statusProcessing {
  105. 0% {
  106. transform: scale(.8);
  107. opacity: .5
  108. }
  109. to {
  110. transform: scale(2.4);
  111. opacity: 0
  112. }
  113. }