@include prefix(button-group) {
  &.button-group-direction-horizontal {
    & > .#{componentName(button)}:not(.button-mode-text) {
      &:not(:first-child) {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
      }

      &:not(:last-child) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;

        &.button-mode-flat {
          @include statusMixin(button) {
            border-right-color: $color-light-3;
            &.button-disabled {
              border-right-color: $color-light-2;
            }
          }
        }

        &.button-mode-fill {
          @include statusMixin(button) {
            border-right-color: $color-4;
          }
        }

        & + .button-mode-outline, & + .button-mode-stroke {
          margin-left: -1px;
        }
      }
    }

    & > .#{componentName(button)}.button-mode-text {
      & + .#{componentName(button)}.button-mode-text {
        margin-left: 12px;
      }
    }
  }

  &.button-group-direction-vertical {
    display: inline-flex;
    flex-direction: column;

    & > .#{componentName(button)}:not(.button-mode-text) {
      &:not(:first-child) {
        border-top-left-radius: 0;
        border-top-right-radius: 0;
      }

      &:not(:last-child) {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;

        &.button-mode-flat {
          @include statusMixin(button) {
            border-bottom-color: $color-light-3;
          }
        }

        &.button-mode-fill {
          @include statusMixin(button) {
            border-bottom-color: $color-4;
          }
        }

        &.button-mode-outline {
          border-bottom-color: transparent;
        }
      }
    }
  }
}
