@use 'sass:map';
@use '~@angular/material' as mat;

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

  rds-c-variable-distribution.mat-primary {
    @include _rds-c-variable-distribution-palette($primary, $accent);
  }
  rds-c-variable-distribution.mat-accent {
    @include _rds-c-variable-distribution-palette($accent, $primary);
  }
}

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

@mixin _rds-c-variable-distribution-palette($themeColor, $secondaryThemeColor) {
  .rds-c-vd-line {
    background-color: mat.get-color-from-palette($themeColor, default);
  }

  .rds-c-vd-min > span,
  .rds-c-vd-max > span {
    color: mat.get-color-from-palette($themeColor, default);
  }

  .rds-c-vd-sdBox,
  .rds-c-vd-mean-shape {
    border-color: mat.get-color-from-palette($secondaryThemeColor, default);
  }
}
