@use 'sass:map'; @use 'sass:meta'; @use 'sass:color'; @use '../core/theming/theming'; // Approximates the correct buffer color by using a mix between the theme color // and the theme's background color. @function _get-buffer-color($theme, $background) { $theme-color: theming.get-color-from-palette($theme); // Return fallback color if the theme uses variables to define colors. @if (meta.type-of($theme-color) != 'color' or meta.type-of($background) != 'color') { @return theming.get-color-from-palette($theme, lighter); } @return color.mix($theme-color, $background, $weight: 25%); } /// @deprecated Use `mat.progress-bar-color` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. /// @breaking-change 17.0.0 @mixin color($config-or-theme) { $config: theming.get-color-config($config-or-theme); $primary: map.get($config, primary); $accent: map.get($config, accent); $warn: map.get($config, warn); $background: map.get(map.get($config, background), background); .mat-progress-bar-background { fill: _get-buffer-color($primary, $background); } .mat-progress-bar-buffer { background-color: _get-buffer-color($primary, $background); } .mat-progress-bar-fill::after { background-color: theming.get-color-from-palette($primary); } .mat-progress-bar.mat-accent { .mat-progress-bar-background { fill: _get-buffer-color($accent, $background); } .mat-progress-bar-buffer { background-color: _get-buffer-color($accent, $background); } .mat-progress-bar-fill::after { background-color: theming.get-color-from-palette($accent); } } .mat-progress-bar.mat-warn { .mat-progress-bar-background { fill: _get-buffer-color($warn, $background); } .mat-progress-bar-buffer { background-color: _get-buffer-color($warn, $background); } .mat-progress-bar-fill::after { background-color: theming.get-color-from-palette($warn); } } } /// @deprecated Use `mat.progress-bar-typography` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. /// @breaking-change 17.0.0 @mixin typography($config-or-theme) {} @mixin _density($config-or-theme) {} /// @deprecated Use `mat.progress-bar-theme` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. /// @breaking-change 17.0.0 @mixin theme($theme-or-color-config) { $theme: theming.private-legacy-get-theme($theme-or-color-config); @include theming.private-check-duplicate-theme-styles($theme, 'mat-legacy-progress-bar') { $color: theming.get-color-config($theme); $density: theming.get-density-config($theme); $typography: theming.get-typography-config($theme); @if $color != null { @include color($color); } @if $density != null { @include _density($density); } @if $typography != null { @include typography($typography); } } }