:host {
  @stroke-color: fade(@global-text-color, 40%);
  @fill-color: fade(@global-text-color, 80%);

  // Parts to create in the element's template
  --parts: dot dot0, dot dot1, dot dot2;

  position: absolute;
  top: 50%;
  left: 50%;
  overflow: hidden;
  width: 70px;
  height: 20px;
  margin: -10px 0 0 -35px;

  &[size='small'] {
    width: 30px;
    height: 6px;
    margin: -3px 0 0 -15px;

    [part~='dot'] {
      width: 5px;
      height: 5px;
    }
  }

  &[size='medium'] {
    width: 42px;
    height: 12px;
    margin: -6px 0 0 -21px;

    [part~='dot'] {
      width: 10px;
      height: 10px;
    }
  }

  [part='wrapper'] {
    box-sizing: border-box;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    &:before,
    &:after {
      content: '';
    }
  }

  [part~='dot'] {
    box-sizing: border-box;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border-width: 1px;
    border-style: solid;
    border-color: @stroke-color;
    animation-duration: 1.2s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
  }

  [part~='dot0'] {
    animation-name: pulse-1;
  }

  [part~='dot1'] {
    animation-name: pulse-2;
  }

  [part~='dot2'] {
    animation-name: pulse-3;
  }

  @keyframes pulse-1 {
    0% {
      background-color: transparent;
    }
    25% {
      background-color: @stroke-color;
    }
    80% {
      background-color: transparent;
    }
    100% {
      background-color: transparent;
    }
  }

  @keyframes pulse-2 {
    0% {
      background-color: transparent;
    }
    10% {
      background-color: transparent;
    }
    50% {
      background-color: @fill-color;
    }
    90% {
      background-color: transparent;
    }
    100% {
      background-color: transparent;
    }
  }

  @keyframes pulse-3 {
    0% {
      background-color: transparent;
    }
    20% {
      background-color: transparent;
    }
    75% {
      background-color: @fill-color;
    }
    100% {
      background-color: transparent;
    }
  }
}
