@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
84 lines (71 loc) • 1.46 kB
text/less
// ESLScrollbar core definition mixin
.esl-scrollbar-init(@tagName: esl-scrollbar) {
@{tagName} {
display: inline-block;
position: absolute;
cursor: default;
overflow: hidden;
&[inactive] {
visibility: hidden;
}
&.page-scrollbar {
position: fixed;
}
.scrollbar-track {
position: relative;
border-radius: 3px;
background: #e7e7e7;
}
.scrollbar-thumb {
position: absolute;
cursor: pointer;
border-radius: 3px;
background: #b5b5b5;
&::after {
content: '';
position: absolute;
top: -5px;
left: -5px;
width: ~'calc(100% + 10px)';
height: ~'calc(100% + 10px)';
}
}
&[dragging] .scrollbar-thumb {
background: #9a9a9a;
}
&:not([horizontal]) {
top: 0;
bottom: 0;
right: 0;
padding: 0 5px;
.scrollbar-track {
top: 0;
width: 6px;
height: 100%;
}
.scrollbar-thumb {
width: 100%;
height: 33.33%;
min-height: 10px;
touch-action: pan-x;
}
}
&[horizontal] {
left: 0;
right: 0;
bottom: 0;
padding: 5px 0;
.scrollbar-track {
bottom: 0;
height: 6px;
width: 100%;
}
.scrollbar-thumb {
height: 100%;
width: 33.33%;
min-width: 10px;
touch-action: pan-y;
}
}
}
}