@use 'sass:map';
@use '~@angular/material' as mat;

@mixin color($theme) {
  $config: mat.get-color-config($theme);
  $background: map.get($config, background);
  $foreground: map.get($config, foreground);

  mtna-header-sort {
    button {
      color: inherit;
      font: inherit;
    }
    &.hovered-text {
      button.mtna-header-sort-text,
      button.mtna-header-sort-indicator {
        background-color: mat.get-color-from-palette($background, hover);
        &:focus-visible,
        &:hover {
          background-color: mat.get-color-from-palette($background, hover, 0.08);
        }
        .indicator-icon {
          color: mat.get-color-from-palette($foreground, text);
          &.inactive {
            color: mat.get-color-from-palette($foreground, hint-text);
          }
        }
      }
    }
  }
}

@mixin typography($theme) {
}

@mixin theme($theme) {
  $config: mat.get-color-config($theme);
  @if $config != null {
    @include color($theme);
  }

  $typography-config: mat.get-typography-config($theme);
  @if $typography-config != null {
    @include typography($theme);
  }
}
