| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- @import "weapp-tailwindcss";
- @config "../tailwind.config.js";
- /* 小程序滚动条样式规范 */
- /* 基于微信小程序设计规范,适配iOS和Android双平台 */
- /* 全局滚动条样式 */
- ::-webkit-scrollbar {
- width: 6rpx;
- height: 6rpx;
- }
- ::-webkit-scrollbar-track {
- background-color: transparent;
- border-radius: 3rpx;
- }
- ::-webkit-scrollbar-thumb {
- background-color: rgba(0, 0, 0, 0.2);
- border-radius: 3rpx;
- transition: background-color 0.2s ease;
- }
- ::-webkit-scrollbar-thumb:hover {
- background-color: rgba(0, 0, 0, 0.3);
- }
- ::-webkit-scrollbar-thumb:active {
- background-color: rgba(0, 0, 0, 0.4);
- }
- /* 深色模式下的滚动条样式 */
- @media (prefers-color-scheme: dark) {
- ::-webkit-scrollbar-thumb {
- background-color: rgba(255, 255, 255, 0.3);
- }
- ::-webkit-scrollbar-thumb:hover {
- background-color: rgba(255, 255, 255, 0.4);
- }
- ::-webkit-scrollbar-thumb:active {
- background-color: rgba(255, 255, 255, 0.5);
- }
- }
- /* 页面滚动容器样式 */
- .scroll-container {
- overflow-y: auto;
- -webkit-overflow-scrolling: touch;
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
- }
- /* 横向滚动容器样式 */
- .scroll-horizontal {
- overflow-x: auto;
- -webkit-overflow-scrolling: touch;
- white-space: nowrap;
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
- }
- /* 卡片滚动样式 */
- .card-scroll {
- max-height: 600rpx;
- overflow-y: auto;
- -webkit-overflow-scrolling: touch;
- }
- .card-scroll::-webkit-scrollbar {
- width: 4rpx;
- }
- .card-scroll::-webkit-scrollbar-thumb {
- background-color: rgba(24, 144, 255, 0.3);
- border-radius: 2rpx;
- }
- /* 列表滚动样式 */
- .list-scroll {
- flex: 1;
- overflow-y: auto;
- -webkit-overflow-scrolling: touch;
- }
- .list-scroll::-webkit-scrollbar {
- width: 0;
- height: 0;
- }
- /* 弹窗滚动样式 */
- .modal-scroll {
- max-height: 800rpx;
- overflow-y: auto;
- -webkit-overflow-scrolling: touch;
- }
- .modal-scroll::-webkit-scrollbar {
- width: 4rpx;
- }
- .modal-scroll::-webkit-scrollbar-thumb {
- background-color: rgba(0, 0, 0, 0.15);
- border-radius: 2rpx;
- }
- /* 自定义滚动条类名 */
- .scrollbar-thin {
- scrollbar-width: thin;
- scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
- }
- .scrollbar-thin::-webkit-scrollbar {
- width: 4rpx;
- height: 4rpx;
- }
- .scrollbar-none {
- -ms-overflow-style: none;
- scrollbar-width: none;
- }
- .scrollbar-none::-webkit-scrollbar {
- display: none;
- }
- /* 主题色滚动条 */
- .scrollbar-primary::-webkit-scrollbar-thumb {
- background-color: rgba(24, 144, 255, 0.5);
- }
- .scrollbar-success::-webkit-scrollbar-thumb {
- background-color: rgba(82, 196, 26, 0.5);
- }
- .scrollbar-warning::-webkit-scrollbar-thumb {
- background-color: rgba(250, 173, 20, 0.5);
- }
- .scrollbar-error::-webkit-scrollbar-thumb {
- background-color: rgba(255, 77, 79, 0.5);
- }
- /* 响应式滚动条 */
- @media screen and (max-width: 375px) {
- ::-webkit-scrollbar {
- width: 4rpx;
- height: 4rpx;
- }
- }
- @media screen and (min-width: 768px) {
- ::-webkit-scrollbar {
- width: 8rpx;
- height: 8rpx;
- }
- }
- /* 滚动条动画效果 */
- @keyframes scrollFadeIn {
- from {
- opacity: 0;
- }
- to {
- opacity: 1;
- }
- }
- .scroll-container:hover::-webkit-scrollbar-thumb {
- animation: scrollFadeIn 0.2s ease;
- }
- /* 滚动条指示器 */
- .scroll-indicator {
- position: relative;
- }
- .scroll-indicator::after {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- width: 2rpx;
- height: 100%;
- background: linear-gradient(to bottom, transparent, rgba(24, 144, 255, 0.3), transparent);
- opacity: 0;
- transition: opacity 0.3s ease;
- }
- .scroll-indicator:hover::after {
- opacity: 1;
- }
|