@use "sass:map";
@use "@angular/material" as mat;
@use "../global/index" as global;
@use "../themes/index" as themes;

@mixin override-color($theme) {
  $color-config: mat.get-color-config($theme);
  $-theme: map.get($theme, theme);

  .mat-mdc-form-field {
    .mdc-text-field--filled:not(.mdc-text-field--disabled) {
      background-color: global.switch(
        $-theme,
        $dark: themes.dark-color-overlay(8),
        $light: map.get(map.get($theme, background), app-bar)
      );
    }
  }
}

@mixin override-theme($theme) {
  $color-config: mat.get-color-config($theme);
  @if $color-config != null {
    @include override-color($theme);
  }
}
