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

@import 'svm-theme-color-styles';
@import 'svm-theme-typo-styles';
@import 'svm-theme-density-styles';
@import 'svm-overwritten-material-styles';

@mixin svm-theme-styles($theme) {
  // Extracts the color and typography configurations from the theme.
  $color: mat.m2-get-color-config($theme);
  $typography: mat.m2-get-typography-config($theme);
  $density: mat.m2-get-density-config($theme);

  // Do not generate styles if configurations for individual theming
  // systems have been explicitly set to `null`.
  @if $color != null {
    @include svm-theme-color-styles($color);
  }
  @if $typography != null {
    @include svm-theme-typo-styles($typography);
  }
  @if $density != null {
    @include svm-theme-density-styles($density);
  }

  @include overwritten-material-styles();
}
