button.wxss 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* ==================
  2. 按钮
  3. ==================== */
  4. .btn {
  5. border: 0rpx;
  6. display: inline-flex;
  7. align-items: center;
  8. justify-content: center;
  9. box-sizing: border-box;
  10. padding: 0 30rpx;
  11. font-size: 28rpx;
  12. height: 64rpx;
  13. line-height: 1;
  14. text-align: center;
  15. text-decoration: none;
  16. overflow: visible;
  17. margin-left: initial;
  18. transform: translate(0rpx, 0rpx);
  19. margin-right: initial;
  20. border-radius: 12rpx;
  21. }
  22. .btn::after {
  23. display: none;
  24. }
  25. .btn:not([class*="bg-"]) {
  26. background-color: #f0f0f0;
  27. }
  28. .btn[class*="border"] {
  29. background-color: transparent;
  30. }
  31. /* 伪元素边框 */
  32. .btn[class*="border"]::after {
  33. content: " ";
  34. display: block;
  35. width: 200%;
  36. height: 200%;
  37. position: absolute;
  38. top: 0;
  39. left: 0;
  40. border: 1rpx solid currentColor;
  41. transform: scale(0.5);
  42. transform-origin: 0 0;
  43. box-sizing: border-box;
  44. z-index: 1;
  45. pointer-events: none;
  46. border-radius: 12rpx;
  47. }
  48. .btn[class*="bg-"]::after {
  49. display: none;
  50. }
  51. .btn.small {
  52. padding: 0 20rpx;
  53. font-size: 20rpx;
  54. height: 48rpx;
  55. border-radius: 10rpx;
  56. }
  57. .btn.mid {
  58. padding: 0 20rpx;
  59. font-size: 24rpx;
  60. height: 50rpx;
  61. border-radius: 10rpx;
  62. }
  63. .btn.large {
  64. padding: 0 40rpx;
  65. font-size: 32rpx;
  66. height: 80rpx;
  67. border-radius: 14rpx;
  68. }
  69. .btn.btn-icon.small {
  70. width: 48rpx;
  71. height: 48rpx;
  72. }
  73. .btn.btn-icon {
  74. width: 64rpx;
  75. height: 64rpx;
  76. border-radius: 500rpx;
  77. padding: 0;
  78. }
  79. button.btn-icon.large {
  80. width: 80rpx;
  81. height: 80rpx;
  82. }
  83. .btn.shadow-blur::before {
  84. top: 4rpx;
  85. left: 4rpx;
  86. filter: blur(6rpx);
  87. opacity: 0.6;
  88. }
  89. .btn.button-hover {
  90. transform: translate(1rpx, 1rpx);
  91. }
  92. .btn[disabled] {
  93. opacity: 0.6;
  94. color: var(--white);
  95. }
  96. .btn.round {
  97. border-radius: 5000rpx;
  98. }
  99. .btn.round[class*="border"]::after {
  100. border-radius: 1000rpx;
  101. }
  102. .btn.border-bold::after {
  103. border: 6rpx solid currentColor;
  104. }