@mixin notebook() {
  notebook {
    padding: 0;

    &.frame {
      margin: -1px;
      border-width: 1px;
      border-style: solid;
      border-color: $borders;

      > header {
        margin: -1px;

        &.top {
          margin-bottom: 0;
        }

        &.bottom {
          margin-top: 0;
        }

        &.left {
          margin-right: 0;
        }

        &.right {
          margin-left: 0;
        }

        &.top, &.bottom {
          padding-left: 0;
          padding-right: 0;
        }

        &.left, &.right {
          padding-top: 0;
          padding-bottom: 0;
        }
      }
    }

    > stack:not(:only-child) {
      background-color: $base_color;
    }

    tab {
      padding: 6px 20px;
      border-width: 1px;
      border-style: solid;
      border-radius: 0;
      border-color: transparent;
      color: $fg_color;
      background-color: transparent;

      &:checked {
        color: $selected_bg_color;

        &:backdrop {
        }
      }

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

    > header {
      background-color: $base_color;
      
      &:backdrop {
        background-color: $unfocused_base_color;
      }

      &.top {
        box-shadow: 0 1px $borders;

        > tabs > tab {
          border-bottom: none;

          &:checked {
            border-top-left-radius: $tab_radius;
            border-top-right-radius: $tab_radius;
          }
        }
      }

      &.bottom {
        box-shadow: 0 -1px $borders;

        > tabs > tab {
          border-top: none;

          &:checked {
            border-bottom-left-radius: $tab_radius;
            border-bottom-right-radius: $tab_radius;
          }
        }
      }

      &.right {
        box-shadow: -1px 0 $borders;

        > tabs > tab {
          border-left: none;

          &:checked {
            border-top-right-radius: $tab_radius;
            border-bottom-right-radius: $tab_radius;
          }
        }
      }

      &.left {
        box-shadow: 1px 0 $borders;

        > tabs > tab {
          border-right: none;

          &:checked {
            border-top-left-radius: $tab_radius;
            border-bottom-left-radius: $tab_radius;
          }
        }
      }
    }

    // alignments
    > header.top > tabs > arrow.up, > header.bottom > tabs > arrow.up {
      -gtk-icon-source: -gtk-icontheme("pan-end-symbolic");

      &:last-child {
        margin-left: 2px;
      }
    }

    > header.top > tabs > arrow.down, > header.bottom > tabs > arrow.down {
      -gtk-icon-source: -gtk-icontheme("pan-start-symbolic");

      &:first-child {
        margin-right: 2px;
      }
    }

    > header.left > tabs > arrow.up, > header.right > tabs > arrow.up {
      -gtk-icon-source: -gtk-icontheme("pan-down-symbolic");

      &:last-child {
        margin-top: 2px;
      }
    }

    > header.left > tabs > arrow.down, > header.right > tabs > arrow.down {
      -gtk-icon-source: -gtk-icontheme("pan-up-symbolic");

      &:first-child {
        margin-bottom: 2px;
      }
    }

    > header > tabs > arrow {
      color: $fg_color;

      &:hover {
        color: gtkshade($fg_color, 1.2);
      }

      &:active {
        color: gtkshade($fg_color, 0.8);
      }

      &:disabled {
        color: gtkshade($bg_color, 0.6);
      }
    }
  }
}
