@use './mixins/mixins' as *;
@use 'element-plus/theme-chalk/el-tree.css';

@include b(tree) {
  @apply pl-5px;
  .el-tree {
    background-color: transparent;
  }
}

@include b(tree-node) {
  flex: 1;
  overflow: hidden;
  display: flex;
  justify-content: space-between;

  @include when(active) {
    color: var(--primary-color);
  }

  @include e(main) {
    flex: 1;
    padding: 5px 2px;
    overflow: hidden;
  }

  @include e(more) {
    margin-left: 10px;
    @apply text-slate-600;
    display: inline-flex;
    align-items: center;
    visibility: hidden;

    .el-icon {
      width: unset;
      height: 100%;
      padding: 5px;
    }

    .el-icon:hover {
      color: var(--el-color-primary);
    }

    @include when(active) {
      visibility: visible;
    }
  }
}

.el-tree-node {
  &.is-dir &__expand-icon,
  &__content:hover .ac-tree-node__more {
    visibility: visible;
  }

  &.is-doc &__expand-icon {
    visibility: hidden;
  }
}

@include b(tree-content) {
  display: flex;
  align-items: center;
  padding-left: 4px;

  @include e(icon) {
    width: 16px;
    margin-left: -5px;
    margin-right: 4px;
    line-height: 1.1;
  }

  @include e(label) {
    flex: 1;
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  @include e(input) {
    flex: 1;
    line-height: 1;
  }

  @include when(active) {
    @include e(label) {
      color: var(--primary-color);
    }
  }
}
