@use '../../style/themes/default.scss' as *;
@use '../../style/util.scss' as *;
@use './css-var.scss' as *;

@include set-tool-var($ele);

.ele-tool {
  line-height: 1;
  color: eleVar('tool', 'color');
  font-size: eleVar('tool', 'font-size');
  padding: eleVar('tool', 'padding');
  border: eleVar('tool', 'border');
  border-radius: eleVar('tool', 'radius');
  background: eleVar('tool', 'bg');
  transition:
    color $transition-base ease-out,
    background-color $transition-base ease-out;
  box-sizing: border-box;
  position: relative;
  cursor: pointer;

  &:hover {
    color: eleVar('tool', 'hover-color');
    background: eleVar('tool', 'hover-bg');
    border: eleVar('tool', 'hover-border');
  }

  .ele-tool-body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .el-dropdown {
    color: inherit;
    cursor: inherit;
    font-size: inherit;
    line-height: inherit;
    position: static;
  }

  .el-tooltip__trigger {
    position: static;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
    }
  }
}

.ele-toolbar .ele-tool {
  flex-shrink: 0;
  margin-top: calc(#{eleVar('toolbar', 'space')} / 2);
  margin-bottom: calc(#{eleVar('toolbar', 'space')} / 2);
  margin-left: eleVar('toolbar', 'space');
  margin-right: 0;
}

/* 朴素风格 */
.ele-toolbar.is-plain .ele-tool {
  color: eleVar('tool', 'plain-color');
  font-size: eleVar('tool', 'plain-font-size');
  padding: eleVar('tool', 'plain-padding');
  border: eleVar('tool', 'plain-border');
  border-radius: eleVar('tool', 'plain-radius');
  background: eleVar('tool', 'plain-bg');

  &:hover {
    color: eleVar('tool', 'plain-hover-color');
    background: eleVar('tool', 'plain-hover-bg');
    border: eleVar('tool', 'plain-hover-border');
  }
}
