badge.wxss 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .t-float-left {
  2. float: left;
  3. }
  4. .t-float-right {
  5. float: right;
  6. }
  7. @keyframes tdesign-fade-out {
  8. from {
  9. opacity: 1;
  10. }
  11. to {
  12. opacity: 0;
  13. }
  14. }
  15. .hotspot-expanded.relative {
  16. position: relative;
  17. }
  18. .hotspot-expanded::after {
  19. content: '';
  20. display: block;
  21. position: absolute;
  22. left: 0;
  23. top: 0;
  24. right: 0;
  25. bottom: 0;
  26. transform: scale(1.5);
  27. }
  28. .t-badge {
  29. position: relative;
  30. display: inline-block;
  31. }
  32. .t-badge--basic {
  33. display: inline-block;
  34. z-index: 100;
  35. font-size: 20rpx;
  36. color: #fff;
  37. background-color: #e34d59;
  38. height: 32rpx;
  39. padding: 0 8rpx;
  40. text-align: center;
  41. line-height: 32rpx;
  42. font-weight: normal;
  43. }
  44. .t-badge--dot {
  45. height: 20rpx;
  46. border-radius: 8rpx;
  47. min-width: 20rpx;
  48. padding: 0;
  49. }
  50. .t-badge--count {
  51. min-width: 32rpx;
  52. white-space: nowrap;
  53. box-sizing: border-box;
  54. }
  55. .t-badge--small {
  56. transform: translate(50%, -50%) scale(0.75);
  57. }
  58. .t-badge--circle {
  59. border-radius: 32rpx;
  60. }
  61. .t-badge--round {
  62. border-radius: 8rpx;
  63. }
  64. .t-badge__ribbon--outer {
  65. position: absolute;
  66. top: 0;
  67. right: 0;
  68. }
  69. .t-badge--ribbon {
  70. transform: rotate(45deg);
  71. }
  72. .t-badge--ribbon::before {
  73. content: '';
  74. position: absolute;
  75. width: 0;
  76. height: 0;
  77. bottom: 0;
  78. left: -32rpx;
  79. border-bottom: 32rpx solid #e34d59;
  80. border-left: 32rpx solid transparent;
  81. }
  82. .t-badge--ribbon::after {
  83. content: '';
  84. position: absolute;
  85. width: 0;
  86. height: 0;
  87. bottom: 0;
  88. right: -32rpx;
  89. border-bottom: 32rpx solid #e34d59;
  90. border-right: 32rpx solid transparent;
  91. }
  92. .t-badge__content:not(:empty) + .t-has-count {
  93. transform: translate(50%, -50%);
  94. position: absolute;
  95. right: 0;
  96. top: 0;
  97. }