@import '../common/functions';

@mixin at-chips-typography($config) {
  .at-chip-content {
    font: {
      family: at-font-family($config);
      size: at-font-size($config, caption);
    }
  }
}

@mixin at-chips-theme($theme) {
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);
  $background: map-get($theme, background);
  $foreground: map-get($theme, foreground);

  // chips
  at-chips {
    // chip
    .mat-basic-chip {
      background: mat-color($background, status-bar);
      color: mat-color($foreground, text);
      &:focus:not(.at-chip-disabled) {
        mat-icon:hover {
          color: mat-color($foreground, icon);
        }
        &.mat-primary {
          background: mat-color($primary);
          &, mat-icon {
            color: mat-color($primary, default-contrast);
          }
        }
        &.mat-accent {
          background: mat-color($accent);
          &, mat-icon {
            color: mat-color($accent, default-contrast);
          }
        }
        &.mat-warn {
          background: mat-color($warn);
          &, mat-icon {
            color: mat-color($warn, default-contrast);
          }
        }
      }
      mat-icon.at-chip-removal {
        color: mat-color($foreground, hint-text);
        &:hover {
          color: mat-color($foreground, icon);
        }
      }
    }
    &.mat-primary {
      .mat-form-field-underline .mat-form-field-ripple {
        background-color: mat-color($primary);
      }
    }
    &.mat-accent {
      .mat-form-field-underline .mat-form-field-ripple {
        background-color: mat-color($accent);
      }
    }
    &.mat-warn {
      .mat-form-field-underline .mat-form-field-ripple {
        background-color: mat-color($warn);
      }
    }
  }
}
