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

  $text: mat.get-color-from-palette($foreground, text);
  $secondary-text: mat.get-color-from-palette($foreground, secondary-text);
  $disabled-text: mat.get-color-from-palette($foreground, disabled-text);

  rds-c-filter-select {
    .filter-select-container {
      .no-variable {
        color: $disabled-text;
      }
      .rds-c-variable-button {
        color: map-get($foreground, secondary-text);
      }
    }
    .rds-c-selection-info-icon::after {
      background: mat.get-color-from-palette($background, background);
    }
  }

  rds-c-filter-dialog {
    .rds-c-filter-dialog-subtitle,
    .mat-dialog-content .codes-selected {
      color: $secondary-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);
  }
}
