@use 'sass:map';
@use '@angular/material' as mat;
@use '../global';
@use '../themes';

@mixin override-color($theme) {
  @if map.get($theme, theme) == "dark" {
    /* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.*/
    /* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.*/
    &.dark-theme .mat-button-toggle-group {
      /* TODO(mdc-migration): The following rule targets internal classes of button that may no longer apply for the MDC version.*/
      .mat-button-toggle {
        background: themes.dark-color-overlay(4);

        &-checked {
          background: themes.dark-color-overlay(0);
        }
      }
    }
  }
}

@mixin override-theme($theme) {
  $color-config: mat.get-color-config($theme);
  @if $color-config != null {
    @include override-color($theme);
  }

  // Do nothing here for now.
  // If you need to override some paddings, or other non color properties
  // you can use the ".mat-button-toggle-group.m-theme" selector.
}
