@top-bottom-width: 4px;
@left-right-width: 100vw;
@offset: -3px;
@height: 100vh;
@width: 4px;

.extendable-border(@top-bottom-width: @top-bottom-width, @left-right-width: @left-right-width, @offset: @offset) {
  position: absolute;
  left: 0;
  width: @left-right-width;
  &:before,
  &:after {
    content: '';
    display: inline-block;
    height: @top-bottom-width;
    width: @left-right-width;
    position: absolute;
  }
  &::before {
    top: @offset;
    left: 0;
  }
  &::after {
    bottom: @offset;
    left: 0;
  }
}

.vertical-border(@height: @height, @width: @width, @offset: @offset) {
  position: absolute;
  top: 0;
  height: @height;
  &:before,
  &:after {
    content: '';
    display: inline-block;
    width: @width;
    height: @height;
    position: absolute;
  }
  &::before {
    left: @offset;
    top: 0;
  }
  &::after {
    right: @offset;
    top: 0;
  }
}

.sketch-ruler {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 12px;

  .canvasedit {
    transform-origin: 0 0;
    will-change: transform;
    backface-visibility: hidden;
  }

  .canvasedit-parent {
    position: absolute;
    overflow: hidden;
    isolation: isolate;
  }

  .corner {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: auto;
    cursor: pointer;
    box-sizing: content-box;
    transition: all 0.2s ease-in-out;
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
  }

  .default,
  .defaultCursor {
    cursor: default !important;
  }

  .grab,
  .grabCursor {
    cursor: grab !important;
  }

  .grabbing,
  .grabbingCursor {
    cursor: grabbing !important;
  }
}

.h-container,
.v-container {
  position: absolute;
}

.h-container {
  top: 0;
}

.v-container {
  left: 0;
}

.lines {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.line {
  position: absolute;
  pointer-events: auto;
}

.h-container .line {
  &::before,
  &::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
  }
  &::before {
    top: -4px;
  }
  &::after {
    bottom: -4px;
  }
}

.v-container .line {
  &::before,
  &::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 4px;
  }
  &::before {
    left: -4px;
  }
  &::after {
    right: -4px;
  }
}

.preview-line {
  position: absolute;
  pointer-events: none;
  z-index: 5;
}

.line-label,
.preview-label {
  position: absolute;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transform: scale(0.83);
}

.h-container .line-label,
.h-container .preview-label {
  top: 14px;
  left: 24px;
}

.v-container .line-label,
.v-container .preview-label {
  top: 24px;
  left: 10px;
}
