@use 'mixins/mixins' as *;
@use 'common/var' as *;

@include b(resizable-columns) {
  height: 100%;
  width: 100%;
  position: relative;

  @include b(resizable-column) {
    height: 100%;
    position: absolute;
    /* 很重要 */
    overflow: hidden;
  }

  .resizer {
    position: absolute;
    background-color: #D4D7DE;
    z-index: 1;

    &.collapsed {
      cursor: auto;
    }

    .left, .right {
      position: absolute;
      z-index: 1001;
      color: getCssVar('color-primary');
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
      padding: 2px 1px;
      font-size: 16px;
      height: 26px;
      width: 18px;
    }

    .left {
      border-bottom-right-radius: 0;
      border-top-right-radius: 0;
      border-right: none;
    }

    .right {
      border-bottom-left-radius: 0;
      border-top-left-radius: 0;
      border-left: none;
    }
  }

  .resizer::after {
    content: "";
    position: absolute;
    height: 100%;
    width: 100%;
    z-index: 1000;
  }

  &.is-horizontal {
    .resizer {
      height: 100%;
      width: 1px;
      cursor: ew-resize;

      .left, .right {
        top: calc(50% - 12px);
      }

      .left {
        right: 1px;
      }

      .right {
        left: 1px;
        margin-left: 0;
      }
    }

    .resizer::after {
      left: 50%;
      top: 0;
      min-width: 12px !important;
      transform: translateX(-50%);
    }
  }

  &.is-vertical {
    .resizer {
      width: 100%;
      height: 1px;
      cursor: ns-resize;

      .left, .right {
        left: calc(50% - 12px);
        transform: rotate(90deg);
      }

      .left {
        bottom: -3px;
      }

      .right {
        bottom: -22px;
        margin-top: 0;
      }
    }

    .resizer::after {
      top: 50%;
      right: 0;
      min-height: 12px !important;
      transform: translateY(-50%);
    }
  }
}
