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

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

  rds-c-dimension-selection {
    .rds-c-selection-info-icon::after {
      background: mat.get-color-from-palette($background, background);
    }
  }

  /* Styles for the select's virtual scroll */
  $itemSize: 48px;

  .rds-c-dimension-virtual-scroll-panel.mat-select-panel {
    /* Since the virtual scroll panel is now the scroll container, */
    /* we have to stop the scroll behavior on mat-select-panel */
    max-height: none;
    overflow: hidden;
    max-width: unset;
    cdk-virtual-scroll-viewport {
      height: $itemSize * 7;
      min-width: 400px;
      &.no-results {
        height: 0px;
      }
    }
  }
}

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