tag.wxss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* ==================
  2. 标签
  3. ==================== */
  4. .tag {
  5. font-size: 24rpx;
  6. vertical-align: middle;
  7. position: relative;
  8. display: inline-flex;
  9. align-items: center;
  10. justify-content: center;
  11. box-sizing: border-box;
  12. padding: 0rpx 16rpx;
  13. height: 48rpx;
  14. font-family: Helvetica Neue, Helvetica, sans-serif;
  15. white-space: nowrap;
  16. }
  17. .tag:not([class*="bg"]):not([class*="border"]) {
  18. background-color: var(--ghostWhite);
  19. }
  20. .tag[class*="border-"]::after {
  21. content: " ";
  22. width: 200%;
  23. height: 200%;
  24. position: absolute;
  25. top: 0;
  26. left: 0;
  27. border: 1rpx solid currentColor;
  28. transform: scale(0.5);
  29. transform-origin: 0 0;
  30. box-sizing: border-box;
  31. border-radius: inherit;
  32. z-index: 1;
  33. pointer-events: none;
  34. }
  35. .tag.radius[class*="border"]::after {
  36. border-radius: 12rpx;
  37. }
  38. .tag.round[class*="border"]::after {
  39. border-radius: 1000rpx;
  40. }
  41. .tag[class*="border-"]::after {
  42. border-radius: 0;
  43. }
  44. .tag.border-bold::after {
  45. border: 6rpx solid currentColor;
  46. }
  47. .tag+.tag {
  48. margin-left: 10rpx;
  49. }
  50. .tag.small {
  51. font-size: 20rpx;
  52. padding: 0rpx 12rpx;
  53. height: 32rpx;
  54. }
  55. .capsule {
  56. display: inline-flex;
  57. vertical-align: middle;
  58. }
  59. .capsule+.capsule {
  60. margin-left: 10rpx;
  61. }
  62. .capsule .tag {
  63. margin: 0;
  64. }
  65. .capsule .tag[class*="border-"]:last-child::after {
  66. border-left: 0rpx solid transparent;
  67. }
  68. .capsule .tag[class*="border-"]:first-child::after {
  69. border-right: 0rpx solid transparent;
  70. }
  71. .capsule.radius .tag:first-child {
  72. border-top-left-radius: 6rpx;
  73. border-bottom-left-radius: 6rpx;
  74. }
  75. .capsule.radius .tag:last-child::after,
  76. .capsule.radius .tag[class*="border-"] {
  77. border-top-right-radius: 12rpx;
  78. border-bottom-right-radius: 12rpx;
  79. }
  80. .capsule.round .tag:first-child {
  81. border-top-left-radius: 200rpx;
  82. border-bottom-left-radius: 200rpx;
  83. text-indent: 4rpx;
  84. }
  85. .capsule.round .tag:last-child::after,
  86. .capsule.round .tag:last-child {
  87. border-top-right-radius: 200rpx;
  88. border-bottom-right-radius: 200rpx;
  89. text-indent: -4rpx;
  90. }
  91. .tag.badge {
  92. border-radius: 200rpx;
  93. position: absolute;
  94. top: -10rpx;
  95. right: -10rpx;
  96. font-size: 20rpx;
  97. padding: 0rpx 10rpx;
  98. height: 28rpx;
  99. color: var(--white);
  100. }
  101. .tag.badge:not([class*="bg-"]) {
  102. background-color: #dd514c;
  103. }
  104. .tag:empty:not([class*="icon-"]) {
  105. padding: 0rpx;
  106. width: 16rpx;
  107. height: 16rpx;
  108. top: -4rpx;
  109. right: -4rpx;
  110. }
  111. .tag[class*="icon-"] {
  112. width: 32rpx;
  113. height: 32rpx;
  114. top: -4rpx;
  115. right: -4rpx;
  116. }