UNPKG

tav-ui

Version:
72 lines (61 loc) 1.18 kB
@import "../var/index.less"; .scrollbar { position: relative; height: 100%; overflow: hidden; &__wrap { height: 100%; overflow: auto; &--hidden-default { scrollbar-width: none; &::-webkit-scrollbar { display: none; width: 0; height: 0; opacity: 0%; } } } &__thumb { position: relative; display: block; width: 0; height: 0; cursor: pointer; background-color: rgb(144 147 153 / 30%); border-radius: inherit; transition: 0.3s background-color; &:hover { background-color: rgb(144 147 153 / 50%); } } &__bar { position: absolute; right: 2px; bottom: 2px; z-index: 1; border-radius: 4px; opacity: 0%; transition: opacity 80ms ease; &.is-vertical { top: 2px; width: 6px; & > div { width: 100%; } } &.is-horizontal { left: 2px; height: 6px; & > div { height: 100%; } } } } .scrollbar:active > .scrollbar__bar, .scrollbar:focus > .scrollbar__bar, .scrollbar:hover > .scrollbar__bar { opacity: 100%; transition: opacity 340ms ease-out; }