@import "../mixins/mixins";
@import "../config/variables";

@include b(scrollbar) {
  overflow: hidden;
  position: relative;

  &:hover,
  &:active,
  &:focus {
    > .el-scrollbar__bar {
      opacity: 1;
      transition: opacity 340ms ease-out;
    }
  }

  @include when(always) {
    > .el-scrollbar__bar {
      opacity: 1;
      transition: opacity 340ms ease-out;
    }
  }

  @include e(wrap) {
    overflow: scroll;
    height: 100%;

    @include m(hidden-default) {
      &::-webkit-scrollbar {
        width: 0;
        height: 0;
      }
    }
  }

  @include e(thumb) {
    position: relative;
    display: block;
    width: 0;
    height: 0;
    cursor: pointer;
    border-radius: inherit;
    background-color: $--color-silver;
    transition: .3s background-color;

    &:hover {
      background-color: $--color-grey;
    }
  }

  @include e(bar) {
    position: absolute;
    right: 8px;
    bottom: 16px;
    z-index: 1;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 120ms ease-out;
    //background: rgba($--color-disabled, 0.3);

    @include when(vertical) {
      width: 4px;
      top: 16px;
      bottom: 16px;
      right: 8px;

      > div {
        width: 100%;
      }
    }

    @include when(horizontal) {
      height: 4px;
      left: 16px;
      bottom: 8px;
      right: 16px;

      > div {
        height: 100%;
      }
    }
  }
}
