.scrollbar-overlay { overflow-y: auto; overflow-y: overlay; -webkit-overflow-scrolling: touch; /* 滚动条美化 */ &::-webkit-scrollbar { width: 12px; height: 12px; } /*滚动条滑块隐藏*/ &::-webkit-scrollbar-thumb { border-radius: 12px; background: rgba(0, 0, 0, 0); } /*按下滚动条,颜色加深*/ &::-webkit-scrollbar-thumb:active { border-radius: 12px; background: rgba(0, 0, 0, .5); } /*滚动条轨道*/ &::-webkit-scrollbar-track { border-radius: 12px; background: rgba(0, 0, 0, 0); } /*鼠标浮到容器上*/ &:hover { /*让该容器的滚动条滑块显示*/ &::-webkit-scrollbar-thumb { border: 3px solid transparent; background: rgba(0, 0, 0, .2); background-clip: content-box; } /*让该容器的滚动条滑块显示*/ &::-webkit-scrollbar-thumb:hover { border: 2px solid transparent; background: rgba(0, 0, 0, .2); background-clip: content-box; } /*按下滚动条,颜色加深*/ &::-webkit-scrollbar-thumb:active { border: 2px solid transparent; background: rgba(0, 0, 0, .5); background-clip: content-box; } } } .scrollbar-hidden { &::-webkit-scrollbar { display: none; } }