.sidebar-pane {
  background-color: $sidebar_bg_color;
  color: $sidebar_fg_color;

  &:backdrop {
    background-color: $sidebar_backdrop_color;
    transition: background-color $backdrop_transition;
  }

  toolbarview.undershoot-top scrolledwindow {
    @include undershoot(top, $sidebar_shade_color);
  }

  toolbarview.undershoot-bottom scrolledwindow {
    @include undershoot(bottom, $sidebar_shade_color);
  }

  scrolledwindow {
    &.undershoot-top {
      @include undershoot(top, $sidebar_shade_color);
    }

    &.undershoot-bottom {
      @include undershoot(bottom, $sidebar_shade_color)
    }

    &.undershoot-start {
      &:dir(ltr) { @include undershoot(left, $sidebar_shade_color); }
      &:dir(rtl) { @include undershoot(right, $sidebar_shade_color); }
    }

    &.undershoot-end {
      &:dir(ltr) { @include undershoot(right, $sidebar_shade_color); }
      &:dir(rtl) { @include undershoot(left, $sidebar_shade_color); }
    }
  }

  flap,
  leaflet,
  navigation-view,
  overlay-split-view {
    @include transition-shadows($sidebar_shade_color);
  }

  banner > revealer > widget {
    background-color: gtkmix($accent_bg_color, $sidebar_bg_color, 30%);
    color: $sidebar_fg_color;

    &:backdrop {
      background-color: gtkmix($accent_bg_color, $sidebar_backdrop_color, 15%);
    }
  }

  &:dir(ltr), &.end:dir(rtl) {
    &, banner > revealer > widget {
      box-shadow: inset -1px 0 if($contrast == 'high', $border_color, $sidebar_shade_color);
    }
  }

  &:dir(rtl), &.end:dir(ltr) {
    &, banner > revealer > widget {
      box-shadow: inset 1px 0 if($contrast == 'high', $border_color, $sidebar_shade_color);
    }
  }
}

/* Middle pane in three-pane setups */
.content-pane .sidebar-pane,
.sidebar-pane .content-pane {
  background-color: $secondary_sidebar_bg_color;
  color: $secondary_sidebar_fg_color;

  &:backdrop {
    background-color: $secondary_sidebar_backdrop_color;
    transition: background-color $backdrop_transition;
  }

  toolbarview.undershoot-top scrolledwindow {
    @include undershoot(top, $secondary_sidebar_shade_color);
  }

  toolbarview.undershoot-bottom scrolledwindow {
    @include undershoot(bottom, $secondary_sidebar_shade_color);
  }

  scrolledwindow {
    &.undershoot-top {
      @include undershoot(top, $secondary_sidebar_shade_color);
    }

    &.undershoot-bottom {
      @include undershoot(bottom, $secondary_sidebar_shade_color)
    }

    &.undershoot-start {
      &:dir(ltr) { @include undershoot(left, $secondary_sidebar_shade_color); }
      &:dir(rtl) { @include undershoot(right, $secondary_sidebar_shade_color); }
    }

    &.undershoot-end {
      &:dir(ltr) { @include undershoot(right, $secondary_sidebar_shade_color); }
      &:dir(rtl) { @include undershoot(left, $secondary_sidebar_shade_color); }
    }
  }

  flap,
  leaflet,
  navigation-view,
  overlay-split-view {
    @include transition-shadows($secondary_sidebar_shade_color);
  }

  banner > revealer > widget {
    background-color: gtkmix($accent_bg_color, $secondary_sidebar_bg_color, 30%);
    color: $secondary_sidebar_fg_color;

    &:backdrop {
      background-color: gtkmix($accent_bg_color, $secondary_sidebar_backdrop_color, 15%);
    }
  }

  &:dir(ltr), &.end:dir(rtl) {
    &, banner > revealer > widget {
      box-shadow: inset -1px 0 if($contrast == 'high', $border_color, $secondary_sidebar_shade_color);
    }
  }

  &:dir(rtl), &.end:dir(ltr) {
    &, banner > revealer > widget {
      box-shadow: inset 1px 0 if($contrast == 'high', $border_color, $secondary_sidebar_shade_color);
    }
  }
}

.sidebar-pane .sidebar-pane {
  background-color: transparent;
  color: inherit;
}

stacksidebar row {
  padding: 10px 4px;

  > label {
    padding-left: 6px;
    padding-right: 6px;
  }

  &.needs-attention > label {
    @extend %needs_attention;
    background-size: 6px 6px, 0 0;
  }
}

/**********************
 * Navigation Sidebar *
 **********************/

.navigation-sidebar {
  &, &.view, &.view:disabled {
    background-color: transparent;
    color: inherit;
  }

  &.background {
    &, &:disabled {
      background-color: $window_bg_color;
      color: $window_fg_color;
    }
  }

  row {
    &.activatable {
      &:hover { background-color: $hover_color; }

      &:active { background-color: $active_color; }

      // this is for indicathing which row generated a popover see https://bugzilla.gnome.org/show_bug.cgi?id=754411
      &.has-open-popup { background-color: $hover_color; }

      &:selected {
        &:hover { background-color: $selected_hover_color; }

        &:active { background-color: $selected_active_color; }

        &.has-open-popup { background-color: $selected_hover_color; }
      }
    }

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

  padding: $menu-margin 0; //only vertical padding. horizontal row size would clip

  > separator {
    margin: $menu-margin;
  }

  > row {
    min-height: 36px;
    padding: 0 8px;
    border-radius: $menu_radius;
    margin: 0 $menu_margin 2px;

    @if $contrast == 'high' {
      &.activatable:hover,
      &.activatable:active,
      &.activatable.has-open-popup,
      &:selected {
        box-shadow: inset 0 0 0 1px $border_color;
      }
    }
  }
}
