@mixin close(
  $size: 24px,
  $x-size:3px,
  $color: $color-gray-6
) {
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  display: inline-block;
  flex-grow: 0;
  flex-shrink: 0;
  font-size: 0;
  height: $size;
  width: $size;
  outline: none;
  position: relative;
  vertical-align: top;
  text-decoration: none;

  &::before {
    height: $x-size;
    width: calc($size / 2);
  }

  &::after {
    height: calc($size / 2);
    width: $x-size;
  }

  &::before,
  &::after {
    position: absolute;
    display: block;
    background-color: $color;
    border-radius: $radius-sm;
    content: "";
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    transform-origin: center center;
  }

  &:hover::before,
  &:hover::after {
    background-color: darken($color, 10);
  }
}

@mixin close-style(
  $style: "bg-dark"
) {

  @if $style == "bg-light" {
    transition: background-color 0.2s ease;

    &::before,
    &::after {
      background-color: $color-gray-7;
    }

    &:hover {
      background-color: rgba(0, 0, 0, 0.1);

      &::before,
      &::after {
        background-color: $color-gray-7;
      }
    }
  }

  @if $style == "bg-dark" {
    transition: background-color 0.2s ease;

    &::before,
    &::after {
      background-color: $color-white;
    }

    &:hover {
      background-color: $badge-close-bg-hover;

      &::before,
      &::after {
        background-color: $color-white;
      }
    }
  }
}

@mixin close-size(
  $size: 24px,
  $x-size:3px
) {
  height: $size;
  width: $size;

  &::before {
    height: $x-size;
    width: calc($size / 2);
  }

  &::after {
    height: calc($size / 2);
    width: $x-size;
  }
}

@mixin delete($size, $color) {
  position: relative;
  display: inline-block;
  flex-grow: 0;
  flex-shrink: 0;
  font-size: 0;
  width: $size;
  height: $size;
  overflow: hidden;

  &:hover {
    cursor: pointer;

    &::before,
    &::after {
      background: $color;
      opacity: 0.6;
    }
  }

  &::before,
  &::after {
    content: '';
    position: absolute;
    height: 2px;
    width: 100%;
    top: 50%;
    background: $color;
  }

  &::before {
    transform: rotate(45deg);
  }

  &::after {
    transform: rotate(-45deg);
  }
}

@mixin delete-color($color) {
  &:hover {
    &::before,
    &::after {
      background: $color;
      opacity: 0.6;
    }
  }

  &::before,
  &::after {
    background: $color;
  }
}
