#{$prefix}tabnav {
  display: flex;
  flex-direction: row;
  align-items: stretch;

  &-tabs {
    overflow-y: hidden;
    overflow-x: auto;
    flex-grow: 1;
    background: #ebf1f6;

    .el-tabs__nav-next,
    .el-tabs__nav-prev {
      font-size: 20px;
      width: 30px;
      text-align: center;
    }

    .el-tabs__nav-wrap.is-scrollable {
      padding: 0 30px;
    }

    .el-tabs__header {
      margin: 0;
      border-bottom: 1px solid $border-color1;

      .el-tabs__nav {
        padding: 0;
        border: none;
        border-radius: 0 !important;

        .el-tabs__item {
          position: relative;
          padding: 0 20px !important;
          margin: 5px 2px;
          user-select: none;
          border-left: none;
          background-color: #fff;
          border-radius: 2px;
          color: $text-color3;

          .el-icon-close {
            display: none;
            position: absolute;
          }

          &:hover {
            padding-right: 25px !important;
            color: #03a9f4;

            .el-icon-close {
              display: inline-block;
            }
          }

          &.is-active {
            padding-left: 25px !important;
            color: #03a9f4;

            &::before {
              content: ' ';
              position: absolute;
              left: 9px;
              display: inline-block;
              width: 10px;
              height: 10px;
              border-radius: 5px;
              background-color: #03a9f4;
            }
          }

          &:focus {
            box-shadow: none !important;
          }

          &:first-child {
            padding-right: 20px !important;

            .el-icon-close {
              display: none !important;
            }
          }
        }
      }
    }
  }

  &-control {
    flex-shrink: 0;

    &-btn {
      display: inline-block;
      width: 30px;
      text-align: center;
      @include vertical-center(40px);
      cursor: pointer;
      border-left: 1px solid;
      border-bottom: 1px solid;
      font-size: 16px;
      box-sizing: border-box;
    }

    &-icon {
      margin-right: 10px;
      font-weight: bold;
    }
  }

  &-contextmenu {
    position: fixed;
    padding: 5px 0;
    background-color: #fff;
    border: 1px solid #ebeef5;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    z-index: 9999;

    li {
      list-style: none;
      line-height: 30px;
      padding: 0 15px;
      margin: 0;
      font-size: 13px;
      color: #606266;
      cursor: pointer;
      outline: none;

      &:first-child {
        border-bottom: 1px solid #ebeef5;
      }

      #{$prefix}icon {
        margin-right: 7px;
        font-size: 17px;
      }

      &:hover {
        background-color: #ecf5ff;
        color: #66b1ff;
      }
    }
  }

  @mixin tabnav-size($height, $fontSize, $beforeTop) {
    #{$prefix}tabnav {
      &-tabs {
        height: $height + 10;

        .el-tabs__header {
          .el-tabs__nav {
            .el-tabs__item {
              @include vertical-center($height);
              font-size: $fontSize;

              .el-icon-close {
                top: ($height - 14) / 2;
                right: 7px;
              }

              &::before {
                top: $beforeTop;
              }
            }
          }

          .el-tabs__nav-prev,
          .el-tabs__nav-next {
            line-height: $height + 15px;
          }
        }
      }

      &-control {
        &-btn {
          @include vertical-center($height + 10);
        }
      }
    }
  }

  &.mini {
    @include tabnav-size(25px, 12px, 8px);
  }

  &.small {
    @include tabnav-size(30px, 12px, 10px);
  }

  &.medium {
    @include tabnav-size(35px, 14px, 12px);
  }

  @include tabnav-size(40px, 15px, 15px);
}
