From 593fc79ecbc6677f04e2d3707bff024b00a517e8 Mon Sep 17 00:00:00 2001 From: Amy Sorto <8575252+amysorto@users.noreply.github.com> Date: Fri, 4 Aug 2023 16:30:47 +0000 Subject: [PATCH] fix(material/progress-spinner): Move unthemable tokens to theme mixin (#27567) Though these tokens are not currently affected by the theme, in the future they will be affected by the design system used for theming (M2 or M3) BREAKING CHANGE: There are new styles emitted by mat.progress-spinner-theme that are not emitted by any of: mat.progress-spinner-color, mat.progress-spinner-typography, mat.progress-spinner-density. If you rely on the partial mixins only and don't call mat.progress-spinner-theme, you can add mat.progress-spinner-base to get the missing styles. --- src/material/_index.scss | 2 +- .../progress-spinner/_progress-spinner-theme.scss | 11 +++++++++++ src/material/progress-spinner/progress-spinner.scss | 3 --- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/material/_index.scss b/src/material/_index.scss index 5519f8833a4b..c80e6fee0b04 100644 --- a/src/material/_index.scss +++ b/src/material/_index.scss @@ -143,7 +143,7 @@ progress-bar-density, progress-bar-base; @forward './progress-spinner/progress-spinner-theme' as progress-spinner-* show progress-spinner-theme, progress-spinner-color, progress-spinner-typography, - progress-spinner-density; + progress-spinner-density, progress-spinner-base; @forward './legacy-progress-spinner/progress-spinner-theme' as legacy-progress-spinner-* show legacy-progress-spinner-theme, legacy-progress-spinner-color, legacy-progress-spinner-typography; @forward './radio/radio-theme' as radio-* show radio-theme, radio-color, radio-typography, diff --git a/src/material/progress-spinner/_progress-spinner-theme.scss b/src/material/progress-spinner/_progress-spinner-theme.scss index 66a468c42321..dbe3311ec3ad 100644 --- a/src/material/progress-spinner/_progress-spinner-theme.scss +++ b/src/material/progress-spinner/_progress-spinner-theme.scss @@ -1,8 +1,18 @@ @use 'sass:map'; +@use '../core/style/sass-utils'; @use '../core/theming/theming'; @use '../core/tokens/m2/mdc/circular-progress' as tokens-mdc-circular-progress; @use '@material/circular-progress/circular-progress-theme' as mdc-circular-progress-theme; +@mixin base($config-or-theme) { + // Add default values for tokens not related to color, typography, or density. + @include sass-utils.current-selector-or-root() { + @include mdc-circular-progress-theme.theme( + tokens-mdc-circular-progress.get-unthemable-tokens() + ); + } +} + @mixin color($config-or-theme) { $config: theming.get-color-config($config-or-theme); $mdc-circular-progress-color-tokens: tokens-mdc-circular-progress.get-color-tokens($config); @@ -33,6 +43,7 @@ $density: theming.get-density-config($theme); $typography: theming.get-typography-config($theme); + @include base($theme); @if $color != null { @include color($color); } diff --git a/src/material/progress-spinner/progress-spinner.scss b/src/material/progress-spinner/progress-spinner.scss index 2e992a134e78..37e5c025e428 100644 --- a/src/material/progress-spinner/progress-spinner.scss +++ b/src/material/progress-spinner/progress-spinner.scss @@ -14,9 +14,6 @@ .mat-mdc-progress-spinner { // Add the official slots for the MDC circular progress. @include mdc-circular-progress-theme.theme-styles($mdc-circular-progress-token-slots); - - // Add default values for tokens that aren't outputted by the theming API. - @include mdc-circular-progress-theme.theme(m2-mdc-circular-progress.get-unthemable-tokens()); } }