app.css 3.6 KB

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