修改全局滚动条:
&::-webkit-scrollbar {
width: 6px;
height: 6px;
background: transparent;
}
&::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 4px;
}
&:hover::-webkit-scrollbar-thumb {
background: hsla(0, 0%, 53%, 0.4);
}
&:hover::-webkit-scrollbar-track {
background: hsla(0, 0%, 53%, 0.1);
}
修改某个滚动条:在前面加上一个类选择器,如下:
.test::-webkit-scrollbar {
width: 6px;
height: 6px;
background: transparent;
}
.test::-webkit-scrollbar-thumb {
background: transparent;
border-radius: 4px;
}
.test:hover::-webkit-scrollbar-thumb {
background: hsla(0, 0%, 53%, 0.4);
}
.test:hover::-webkit-scrollbar-track {
background: hsla(0, 0%, 53%, 0.1);
}