@use "../../styles/utils";
@use "../../styles/buttons";
@use "./variables" as locals;

@include utils.layer {
  @include buttons.base;

  %sizeDefaults {
    height: 2.5rem;
    font-size: var(--cmm-font-size-sm);
    padding: 0 1rem;
  }

  .Block {
    @extend %sizeDefaults;

    border-radius: var(--cmm-Button-radius, var(--cmm-radius-lg));

    // Sizes

    &--sm {
      height: 2rem;
      font-size: var(--cmm-font-size-sm);
      padding: 0 0.75rem;
    }

    &--md {
      @extend %sizeDefaults;
    }

    &--lg {
      height: 3rem;
      font-size: var(--cmm-font-size-md);
      padding: 0 1.25rem;
    }
  }

  // Icon

  %icon {
    display: flex;
    align-items: center;
    > svg {
      @include utils.size(locals.$iconSize);
    }
  }

  .startDecorator {
    @extend %icon;

    margin-right: locals.$iconMargin;
  }

  .endDecorator {
    @extend %icon;

    margin-left: locals.$iconMargin;
  }
}
