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

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

    &:backdrop { background-color: gtkshade($bg_color, 0.9); }
    
    button {
      &, &:hover, &:active, &:disabled {
        &, &:backdrop {
          padding: 3px;
          border: none;
          background-color: transparent;
          background-image: none;
          background-size: 100% 100%;
          box-shadow: none;
          color: transparent;
        }
      }
    }

    &.fine-tune {
    }

    &.overlay-indicator {
      opacity: 1;
    }

    &.horizontal {
      background-image: linear-gradient(to bottom, $bg_color, gtkshade($bg_color, 1.1));
    
      slider {
        min-width: 45px;
        min-height: 14px;
        margin: 0;
        border: 1px solid gtkshade($bg_color, 0.75);
        border-radius: $scrollbar_radius;
        background-clip: padding-box;
        background-color: gtkshade($bg_color, 0.6);
        background: url("assets/handle-vert.png") no-repeat center center, linear-gradient(to bottom, $bg_color 50%, gtkshade($bg_color, 0.95) 51%, gtkshade($bg_color, 0.94));

        &:hover {
          border-color: gtkshade($selected_bg_color, 0.7);
          background-color: gtkshade($bg_color, 0.6);
          background: url("assets/handle-horiz-hover.png") no-repeat center center, linear-gradient(to bottom, gtkshade($selected_bg_color, 1.12), $selected_bg_color 50%, gtkshade($selected_bg_color, 0.95) 51%);

          &:active {
            border-color: gtkshade($selected_bg_color, 0.6);
            background-color: gtkshade($bg_color, 0.55);
            background: url("assets/handle-horiz-hover.png") no-repeat center center, linear-gradient(to bottom, gtkshade($selected_bg_color, 1.07), gtkshade($selected_bg_color, 0.95) 50%, gtkshade($selected_bg_color, 0.9) 51%);
          }
        }

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

        &:disabled {
          background-color: transparent;
        }
      }

      button {
        min-height: 6px;
        min-width: 10px;
      
        &.down {
          background-image: url('assets/stepper-right.png');
          
          &:hover, &:active {
            background-image: url('assets/stepper-right-hover.png');
          }
        }

        &.up {
          background-image: url('assets/stepper-left.png');
          
          &:hover, &:active {
            background-image: url('assets/stepper-left-hover.png');
          }
        }
      }
    }

    &.vertical {
      background-image: linear-gradient(to right, $bg_color, gtkshade($bg_color, 1.1));
      
      slider {
        min-width: 14px;
        min-height: 45px;
        margin: 0;
        border: 1px solid gtkshade($bg_color, 0.75);
        border-radius: $scrollbar_radius;
        background-clip: padding-box;
        background-color: gtkshade($bg_color, 0.6);
        background: url("assets/handle-vert.png") no-repeat center center, linear-gradient(to right, $bg_color 50%, gtkshade($bg_color, 0.95) 51%, gtkshade($bg_color, 0.94));

        &:hover {
          border-color: gtkshade($selected_bg_color, 0.7);
          background-color: gtkshade($bg_color, 0.6);
          background: url("assets/handle-vert-hover.png") no-repeat center center, linear-gradient(to right, gtkshade($selected_bg_color, 1.12), $selected_bg_color 50%, gtkshade($selected_bg_color, 0.95) 51%);

          &:active {
            border-color: gtkshade($selected_bg_color, 0.6);
            background-color: gtkshade($bg_color, 0.55);
            background: url("assets/handle-vert-hover.png") no-repeat center center, linear-gradient(to right, gtkshade($selected_bg_color, 1.07), gtkshade($selected_bg_color, 0.95) 50%, gtkshade($selected_bg_color, 0.9) 51%);
          }
        }

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

        &:disabled {
          background-color: transparent;
        }
      }

      button {
        min-height: 10px;
        min-width: 6px;

        &.down {
          background-image: url('assets/stepper-down.png');
          
          &:hover, &:active {
            background-image: url('assets/stepper-down-hover.png');
          }
        }

        &.up {
          background-image: url('assets/stepper-up.png');
          
          &:hover, &:active {
            background-image: url('assets/stepper-up-hover.png');
          }
        }
      }
    }

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