app.css 3.6 KB

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