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

@mixin styles-reset-theme($theme) {
  $primary: map.get($theme, primary);
  $accent: map.get($theme, accent);
  $warn: map.get($theme, warn);
  $foreground: map.get($theme, foreground);
  $background: map.get($theme, background);

  a {
    color: mat.m2-get-color-from-palette($primary);

    &:hover {
      color: mat.m2-get-color-from-palette($primary, darker);
    }
  }

  code {
    color: mat.m2-get-color-from-palette($foreground, text);
    background-color: mat.m2-get-color-from-palette(
      $background,
      unselected-chip
    );

    &[color='primary'] {
      color: mat.m2-get-color-from-palette($primary, default-contrast);
      background-color: mat.m2-get-color-from-palette($primary);
    }

    &[color='accent'] {
      color: mat.m2-get-color-from-palette($accent, default-contrast);
      background-color: mat.m2-get-color-from-palette($accent);
    }

    &[color='warn'] {
      color: mat.m2-get-color-from-palette($warn, default-contrast);
      background-color: mat.m2-get-color-from-palette($warn);
    }
  }
}
