app.css 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. @import "weapp-tailwindcss";
  2. @config "../tailwind.config.js";
  3. /* 全局 box-sizing 设置,防止 padding 导致宽度溢出 */
  4. * {
  5. box-sizing: border-box;
  6. }
  7. /* 小程序滚动条样式规范 */
  8. /* 基于微信小程序设计规范,适配iOS和Android双平台 */
  9. /* 全局滚动条样式 */
  10. ::-webkit-scrollbar {
  11. width: 6rpx;
  12. height: 6rpx;
  13. }
  14. ::-webkit-scrollbar-track {
  15. background-color: transparent;
  16. border-radius: 3rpx;
  17. }
  18. ::-webkit-scrollbar-thumb {
  19. background-color: rgba(0, 0, 0, 0.2);
  20. border-radius: 3rpx;
  21. transition: background-color 0.2s ease;
  22. }
  23. ::-webkit-scrollbar-thumb:hover {
  24. background-color: rgba(0, 0, 0, 0.3);
  25. }
  26. ::-webkit-scrollbar-thumb:active {
  27. background-color: rgba(0, 0, 0, 0.4);
  28. }
  29. /* 深色模式下的滚动条样式 */
  30. @media (prefers-color-scheme: dark) {
  31. ::-webkit-scrollbar-thumb {
  32. background-color: rgba(255, 255, 255, 0.3);
  33. }
  34. ::-webkit-scrollbar-thumb:hover {
  35. background-color: rgba(255, 255, 255, 0.4);
  36. }
  37. ::-webkit-scrollbar-thumb:active {
  38. background-color: rgba(255, 255, 255, 0.5);
  39. }
  40. }
  41. /* 页面滚动容器样式 */
  42. .scroll-container {
  43. overflow-y: auto;
  44. -webkit-overflow-scrolling: touch;
  45. scrollbar-width: thin;
  46. scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  47. }
  48. /* 横向滚动容器样式 */
  49. .scroll-horizontal {
  50. overflow-x: auto;
  51. -webkit-overflow-scrolling: touch;
  52. white-space: nowrap;
  53. scrollbar-width: thin;
  54. scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  55. }
  56. /* 卡片滚动样式 */
  57. .card-scroll {
  58. max-height: 600rpx;
  59. overflow-y: auto;
  60. -webkit-overflow-scrolling: touch;
  61. }
  62. .card-scroll::-webkit-scrollbar {
  63. width: 4rpx;
  64. }
  65. .card-scroll::-webkit-scrollbar-thumb {
  66. background-color: rgba(24, 144, 255, 0.3);
  67. border-radius: 2rpx;
  68. }
  69. /* 列表滚动样式 */
  70. .list-scroll {
  71. flex: 1;
  72. overflow-y: auto;
  73. -webkit-overflow-scrolling: touch;
  74. }
  75. .list-scroll::-webkit-scrollbar {
  76. width: 0;
  77. height: 0;
  78. }
  79. /* 弹窗滚动样式 */
  80. .modal-scroll {
  81. max-height: 800rpx;
  82. overflow-y: auto;
  83. -webkit-overflow-scrolling: touch;
  84. }
  85. .modal-scroll::-webkit-scrollbar {
  86. width: 4rpx;
  87. }
  88. .modal-scroll::-webkit-scrollbar-thumb {
  89. background-color: rgba(0, 0, 0, 0.15);
  90. border-radius: 2rpx;
  91. }
  92. /* 自定义滚动条类名 */
  93. .scrollbar-thin {
  94. scrollbar-width: thin;
  95. scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  96. }
  97. .scrollbar-thin::-webkit-scrollbar {
  98. width: 4rpx;
  99. height: 4rpx;
  100. }
  101. .scrollbar-none {
  102. -ms-overflow-style: none;
  103. scrollbar-width: none;
  104. }
  105. .scrollbar-none::-webkit-scrollbar {
  106. display: none;
  107. }
  108. /* 主题色滚动条 */
  109. .scrollbar-primary::-webkit-scrollbar-thumb {
  110. background-color: rgba(24, 144, 255, 0.5);
  111. }
  112. .scrollbar-success::-webkit-scrollbar-thumb {
  113. background-color: rgba(82, 196, 26, 0.5);
  114. }
  115. .scrollbar-warning::-webkit-scrollbar-thumb {
  116. background-color: rgba(250, 173, 20, 0.5);
  117. }
  118. .scrollbar-error::-webkit-scrollbar-thumb {
  119. background-color: rgba(255, 77, 79, 0.5);
  120. }
  121. /* 响应式滚动条 */
  122. @media screen and (max-width: 375px) {
  123. ::-webkit-scrollbar {
  124. width: 4rpx;
  125. height: 4rpx;
  126. }
  127. }
  128. @media screen and (min-width: 768px) {
  129. ::-webkit-scrollbar {
  130. width: 8rpx;
  131. height: 8rpx;
  132. }
  133. }
  134. /* 滚动条动画效果 */
  135. @keyframes scrollFadeIn {
  136. from {
  137. opacity: 0;
  138. }
  139. to {
  140. opacity: 1;
  141. }
  142. }
  143. .scroll-container:hover::-webkit-scrollbar-thumb {
  144. animation: scrollFadeIn 0.2s ease;
  145. }
  146. /* 滚动条指示器 */
  147. .scroll-indicator {
  148. position: relative;
  149. }
  150. .scroll-indicator::after {
  151. content: '';
  152. position: absolute;
  153. top: 0;
  154. right: 0;
  155. width: 2rpx;
  156. height: 100%;
  157. background: linear-gradient(to bottom, transparent, rgba(24, 144, 255, 0.3), transparent);
  158. opacity: 0;
  159. transition: opacity 0.3s ease;
  160. }
  161. .scroll-indicator:hover::after {
  162. opacity: 1;
  163. }