naive-ui/styles/Scrollbar.scss

82 lines
2.0 KiB
SCSS
Raw Normal View History

2019-07-31 17:31:35 +08:00
@import './mixins/mixins.scss';
2020-02-11 14:44:29 +08:00
2019-09-20 17:37:38 +08:00
@include themes-mixin {
@include b(scrollbar) {
2019-12-15 19:44:35 +08:00
@include once {
position: relative;
z-index: auto;
2019-12-15 19:44:35 +08:00
height: 100%;
}
& > {
2019-12-15 19:44:35 +08:00
@include once {
@include b(scrollbar-container) {
width: 100%;
overflow: scroll;
height: 100%;
max-height: inherit;
scrollbar-width: none;
2019-12-15 19:44:35 +08:00
&::-webkit-scrollbar {
width: 0;
height: 0;
}
& > {
@include b(scrollbar-content) {
width: fit-content;
overflow: hidden;
min-width: 100%;
}
}
}
}
2019-12-15 19:44:35 +08:00
@include b(scrollbar-rail) {
@include once {
position: absolute;
pointer-events: none;
2019-12-15 19:44:35 +08:00
user-select: none;
@include m(horizontal) {
left: 0;
right: 0;
bottom: 2.5px;
& > {
@include e(scrollbar) {
right: 0;
}
}
}
@include m(vertical) {
right: 2.5px;
top: 0;
bottom: 0;
& > {
@include e(scrollbar) {
bottom: 0;
}
}
}
@include m(disabled) {
& > {
@include e(scrollbar) {
pointer-events: none;
}
}
}
}
2019-12-15 19:44:35 +08:00
& > {
@include e(scrollbar) {
@include once {
@include fade-in-transition(scrollbar);
position: absolute;
cursor: pointer;
pointer-events: all;
2019-12-15 19:44:35 +08:00
}
2020-02-20 13:22:48 +08:00
background-color: map-get($--scrollbar-background-color, 'default');
transition: background-color .2s $--n-ease-in-out-cubic-bezier;
2019-12-15 19:44:35 +08:00
&:hover {
2020-02-20 13:22:48 +08:00
background-color: map-get($--scrollbar-background-color, 'hover');
2019-12-15 19:44:35 +08:00
}
}
2019-09-20 17:37:38 +08:00
}
}
2019-07-31 17:31:35 +08:00
}
}
}