@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);
  $primary: map.get($config, primary);
  $standard-curve: cubic-bezier(0.4, 0, 0.2, 1);
  $duration: 250ms;
  $motion: $duration $standard-curve;

  mtna-resizable-panel {
    background-color: mat.get-color-from-palette($background, app-bar);

    .mtna-resizable-panel-drag-handle:hover {
      .mtna-resizable-panel-drag-handle-line {
        background-color: mat.get-color-from-palette($foreground, secondary-text);
      }
    }

    .mtna-resizable-panel-drag-handle-line {
      background-color: mat.get-color-from-palette($foreground, divider);
      transition: background-color $motion;
    }

    .mtna-resizable-panel-expand-button {
      background: mat.get-color-from-palette($primary, default);
      .mat-icon {
        color: mat.get-color-from-palette($primary, default-contrast);
      }
    }

    .mtna-resizable-panel-drag-handle-disabled {
      .mtna-resizable-panel-expand-button {
        background: mat.get-color-from-palette($foreground, disabled-button);
        .mat-icon {
          color: mat.get-color-from-palette($foreground, disabled-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);
  }
}
