@mixin scrollbar() {
  scrollbar {
    border: none;
    background-color: gtkshade($bg_color, 1.2);

    trough {
      border: none;
      border-radius: 0;
    }

    &:backdrop { background-color: $unfocused_base_color; }

    slider {
      min-width: 8px;
      min-height: 8px;
      margin: 2px;
      border: none;
      border-radius: $scrollbar_radius;
      background-clip: padding-box;
      background-color: gtkmix($bg_color, $fg_color, 0.4);

      &:hover {
        background-color: gtkmix($bg_color, $fg_color, 0.4);

        &:active { background-color: gtkmix($bg_color, $fg_color, 0.45); }
      }

      &:backdrop { background-color: gtkmix($bg_color, $fg_color, 0.45); }
      &:disabled { background-color: transparent; }
    }

    &.fine-tune {
      slider {
        min-width: 6px;
        min-height: 6px;
        border-radius: $scrollbar_radius;
      }

      &.horizontal slider {
        margin-top: 1px;
        margin-bottom: 1px;
      }

      &.vertical slider {
        margin-left: 1px;
        margin-right: 1px;
      }
    }

    &.overlay-indicator {
      &:not(.dragging):not(.hovering) {
        border: none;
        opacity: 0.7;
        margin: 0;
        background-color: transparent;

        slider {
          margin: 0;
          min-width: 1px;
          min-height: 1px;
          background-color: gtkshade($bg_color, 0.6);
          border: none;
        }

        &.horizontal {
          slider {
            margin: 0;
            min-width: 40px;
          }
        }

        &.vertical {
          slider {
            margin: 0;
            min-height: 40px;
          }
        }
      }
      
      &.dragging, &.hovering { opacity: 1; }
    }

    &.horizontal {
      border-top: 1px solid $borders;
      
      slider { min-width: 40px; }
      button {
        &.down { -gtk-icon-source: -gtk-icontheme("pan-right-symbolic"); }
        &.up { -gtk-icon-source: -gtk-icontheme("pan-left-symbolic"); }
      }
    }

    &.vertical {
      border-left: 1px solid $borders;
      
      slider { min-height: 40px; }
      button {
        &.down { -gtk-icon-source: -gtk-icontheme("pan-down-symbolic"); }
        &.up { -gtk-icon-source: -gtk-icontheme("pan-up-symbolic"); }
      }
    }

    treeview ~ &.vertical {
      border-top: 1px solid $borders;
      margin-top: -1px;
    }
  }
}
