app.css 3.5 KB

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