@use 'sass:map';
@use '~@angular/material' as mat;
@use '../../lib/core/mixins';

@mixin color($theme) {
  $config: mat.get-color-config($theme);
  $primary: map.get($config, primary);

  mtna-side-panel-layout {
    > .mat-icon-button.mtna-side-panel-toggle-button {
      background: mat.get-color-from-palette($primary, default);
      mat-icon {
        color: mat.get-color-from-palette($primary, default-contrast);
      }
      &:focus-visible {
        background: mat.get-color-from-palette($primary, lighter);
        .mat-icon {
          color: mat.get-color-from-palette($primary, lighter-contrast);
        }
      }
    }
    @include mixins.mtna-side-panel-toggle-theme($theme);
  }
}

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