/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

.tip-variant(@color; @fontColor; @shadow; @top) {
  background: @color;
  color: @fontColor;
  border-radius: var(--ti-tips-border-radius-large, 3px);
  box-shadow: @shadow;
  margin-top: @top;

  &:before {
    .tip-make-arrow(4px 4px 4px 0; transparent @color);
  }

  &.tips-bottom {
    &:before {
      .tip-make-arrow(0 4px 4px 4px; @color transparent);
    }
  }

  &.tips-left {
    &:before {
      .tip-make-arrow(4px 0 4px 4px; transparent @color);
    }
  }

  &.tips-top {
    &:before {
      .tip-make-arrow(4px 4px 0 4px; @color transparent);
    }
  }

  &.tips-bottom-left {
    &:before {
      .tip-make-arrow(0 4px 4px 4px; @color transparent);
    }
  }

  &.tips-bottom-right {
    &:before {
      .tip-make-arrow(0 4px 4px 4px; @color transparent);
    }
  }

  &.tips-top-left {
    &:before {
      .tip-make-arrow(4px 4px 0 4px; @color transparent);
    }
  }

  &.tips-top-right {
    &:before {
      .tip-make-arrow(4px 4px 0 4px; @color transparent);
    }
  }
}

.tip-arrow (@tips-arrow-left; @tips-arrow-top; @tips-arrow-margin-top) {
  content: '';
  left: @tips-arrow-left;
  top: @tips-arrow-top;
  margin-top: @tips-arrow-margin-top;
}

.tip-make-arrow (@border-width; @arrow-color) {
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: @border-width;
  border-color: @arrow-color;
}
