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

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

    &:backdrop {
      background-color: gtkshade($unfocused_bg_color, 0.9);
    }

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

      &:hover {
        background-color: gtkshade($bg_color, 0.6);

        &:active {
          background-color: gtkshade($bg_color, 0.55);
        }
      }

      &:backdrop {
        background-color: gtkshade($bg_color, 0.55);
      }

      &: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;
        }
      }
    }

    &.overlay-indicator {
      &.dragging, &.hovering {
        opacity: 1;
      }
    }

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

      button {
        &.down {
          -gtk-icon-source: -gtk-icontheme("pan-right-symbolic");
        }

        &.up {
          -gtk-icon-source: -gtk-icontheme("pan-left-symbolic");
        }
      }
    }

    &.vertical {
      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;
    }
  }
}
