@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-catalog-header.mat-primary {
    @include _rds-c-catalog-header-palette($primary);
  }
  rds-c-catalog-header.mat-accent {
    @include _rds-c-catalog-header-palette($accent);
  }
}

@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-catalog-header-palette($themePalette) {
  $headerStartColor: mat.get-color-from-palette($themePalette, default);
  $headerEndColor: mat.get-color-from-palette($themePalette, default, 0);
  background-image: linear-gradient(to right, #{$headerStartColor} 0%, #{$headerEndColor} 100%);
}
