@mixin progressbar() {
  progressbar {
    padding: 0;
    border: none;
    color: gtkmix($fg_color, $selected_fg_color, 0.5);
    background-color: transparent;

    progress {
      border: 1px solid gtkshade($selected_bg_color, 0.5);
      border-radius: 1px;
      background-color: $selected_bg_color;

      &:backdrop {
        border-color: $unfocused_selected_bg_color;
        background-color: $unfocused_selected_bg_color;
      }

      // alignments
      &.left {
       border-top-left-radius: $progressbar_radius;
       border-bottom-left-radius: $progressbar_radius;
      }

      &.right {
       border-top-right-radius: $progressbar_radius;
       border-bottom-right-radius: $progressbar_radius;
      }

      &.top {
       border-top-right-radius: $progressbar_radius;
       border-top-left-radius: $progressbar_radius;
      }

      &.bottom {
       border-bottom-right-radius: $progressbar_radius;
       border-bottom-left-radius: $progressbar_radius;
      }
    }

    trough {
      border: 1px solid $borders;
      border-radius: $progressbar_radius;
      background-color: gtkalpha($dark_shadow, 0.1);

      &:backdrop {
        background-color: gtkalpha($dark_shadow, 0.05);
      }
    }

    &.horizontal {
      trough { min-width: 150px; }

      trough,
      progress { min-height: 2px; }

      progress { margin: 0 -1px; }
    }

    &.vertical {
      trough { min-height: 80px; }

      trough,
      progress { min-width: 2px; }

      progress { margin: -1px 0; }
    }
  }

  treeview.view {
    &.progressbar {
      &, &:disabled {
        color: $selected_fg_color;
        border-radius: 0;
        background-color: $selected_bg_color;
      }

      &:focus, &:selected:focus, &:focus:selected, &:focus:selected:focus, &:disabled:selected {
        border-radius: 0;
        color: $selected_bg_color;
        background-color: $selected_fg_color;
      }
    }

    &.trough {
      color: $fg_color;
      background-color: gtkalpha($dark_shadow, 0.1);
      border-radius: 0;
      border: none;

      &:selected, &:selected:focus {
        color: $selected_fg_color;
        background-color: gtkalpha($dark_shadow, 0.1);
        border-radius: 0;
        border: none;
      }
    }

    infobar & trough, row:selected & trough { background-color: gtkalpha($dark_shadow, 0.1); }
  }
}
