react-concise-scrollbar
Version:
a React concise scrollbar component with macOS style
60 lines (54 loc) • 1 kB
CSS
.scrollbar-wrapper {
position: relative;
overflow: hidden;
}
.scrollbar-track{
right: 2px;
top: 2px;
background: transparent;
z-index: 100;
height: calc(100% - 4px);
position: absolute;
}
@media only screen and (max-width: 599px) {
.scrollbar-track{
width: 5px;
}
.scrollbar-thumb {
width: 5px;
border-radius: 10px;
}
}
@media only screen and (min-width: 600px){
.scrollbar-track {
width: 7px;
}
.scrollbar-thumb {
width: 7px;
border-radius: 8px;
}
}
.scrollbar-thumb {
transition: opacity 0.3s ease-out;
z-index: 100;
position: absolute;
content: '';
background: black;
opacity: 0;
}
.scrollbar-thumb.thumb-show {
opacity: 0.4;
}
.scrollbar-content {
width: 100%;
height: 100%;
position: relative;
overflow: auto;
}
.scrollbar-content::-webkit-scrollbar {
display: none;
}
.scrollbar-children{
z-index: 2;
overflow: hidden;
}