Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
_smp-theme-helper.scss 900 B
Newer Older
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
// class contains DomiSMP theme helper functions
@use 'sass:map';
@use '@angular/material' as mat;

@function get-theme-type($smp-theme ) {
  $color-config: mat.m2-get-color-config($smp-theme);
  @return map.get($color-config, type);
}

@function get-theme-color($smp-theme, $color: primary, $hue: null,  $opacity: null ) {
  $color-config: mat.m2-get-color-config($smp-theme);
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
  // Get the required color palette from the color-config.
  $color-palette: map.get($color-config, $color);
  @if $hue != null {
    @if $opacity != null {
      @return mat.m2-get-color-from-palette($color-palette, $hue, $opacity);
    } @else {
      // Finally get the desired color with the specified hue.
      @return mat.m2-get-color-from-palette($color-palette, $hue);
Joze RIHTARSIC's avatar
Joze RIHTARSIC committed
  } @else {
    // Finally get the desired color with the specified hue.
    @return mat.m2-get-color-from-palette($color-palette);