@import (reference) '../themes/default.less';

.scale-hairline-common(@color, @top, @right, @bottom, @left) {
  content: '';
  position: absolute;
  background-color: @color;
  display: block;
  top: @top;
  right: @right;
  bottom: @bottom;
  left: @left;
}

.hairline(@direction, @color: @color-divider-line) when (@direction = 'top') {
  &::before {
    .scale-hairline-common(@color, 0, 0, auto, 0);
    height: 1px;
    transform: scaleY(0.5);
  }
}

.hairline(@direction, @color: @color-divider-line) when (@direction = 'right') {
  &::after {
    .scale-hairline-common(@color, 0, 0, 0, auto);
    width: 1px;
    transform: scaleX(0.5);
  }
}

.hairline(@direction, @color: @color-divider-line) when (@direction = 'bottom') {
  &::after {
    .scale-hairline-common(@color, auto, 0, 0, 0);
    height: 1px;
    transform: scaleY(0.5);
  }
}

.hairline(@direction, @color: @color-divider-line) when (@direction = 'left') {
  &::before {
    .scale-hairline-common(@color, 0, auto, 0, 0);
    width: 1px;
    transform: scaleX(0.5);
  }
}
