@mixin treeview() {
  treeview {
    -treeview-vertical-separator: 0;

    &.view {
      border-bottom: 1px solid gtkalpha($borders, 0.5);
      
      &:backdrop { border-color: gtkalpha($unfocused_borders, 0.5); }
    
      &:selected, &:selected:focus {
        border-radius: 0;
        color: $selected_fg_color;
        background-color: $selected_bg_color;

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

      &:drop(active) {
        border-style: solid none;
        border-width: 1px;
        border-color: $selected_bg_color;

        &.after { border-top-style: none; }
        &.before { border-bottom-style: none; }
      }
    }

    header {
      button {
        border-radius: 0;
        padding: 0 6px;
        border-style: solid;
        border-width: 0 1px 1px 0;
        font-weight: bold;
        color: gtkmix($base_color, $text_color, 0.6);
        background-image: none;
        background-color: $base_color;

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

        &:last-child { border-width: 0 0 1px 0; }

        &, &:focus {
          &:hover {
            color: gtkmix($base_color, $text_color, 0.75);
            background-image: none;
            background-color: $base_color;
          }

          &:active {
            color: $text_color;
            background-image: none;
          }

          &:selected { background-color: $selected_bg_color; }
        }
      }
    }

    entry, entry.flat {
      border-radius: 0;
      background-image: none;
      background-color: $base_color;
      transition-property: color, background;

      &:focus { border-color: $selected_bg_color; }
    }
  }
}
