@use "./variables";
@use "./utils";

@mixin modifier($variant, $scheme) {
  .Block--#{$variant}.Block--#{$scheme} {
    background: var(--cmm-color-#{$scheme}-#{$variant}-bg);
    color: var(--cmm-color-#{$scheme}-#{$variant}-font);
    border-color: var(--cmm-color-#{$scheme}-#{$variant}-border);

    &:hover:not(:disabled) {
      background: var(--cmm-color-#{$scheme}-#{$variant}-bg-hover);
    }
  }
}

@mixin base() {
  .Block {
    font-weight: var(--cmm-font-weight-semibold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: var(--cmm-transition-bg);
    outline-offset: 2px;

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
  }
  // Modifiers
  @each $variant in variables.$variants {
    @each $scheme in variables.$colorSchemes {
      @include modifier($variant, $scheme);
    }
  }

  .Block--outline {
    border-width: 1px;
    border-style: solid;
  }
}
