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

@mixin color($theme) {
  $config: mat.get-color-config($theme);
  $foreground: map.get($config, foreground);
  $background: map.get($config, background);
  $secondary-text: mat.get-color-from-palette($foreground, secondary-text);
  $icon: mat.get-color-from-palette($foreground, icon);

  rds-c-format-selection-list {
    p.mat-line {
      color: $secondary-text;
    }
    .mat-list.mat-list-base .mat-list-item .rds-c-format-count {
      &:hover,
      &:focus {
        outline: unset;
        background-color: mat.get-color-from-palette($background, focused-button);
      }
      &::after {
        color: $icon;
        border-color: $icon;
        background-color: mat.get-color-from-palette($background, card);
      }
    }
  }
}

@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);
  }
}
