diff --git a/src/material/core/_m2-app.scss b/src/material/core/_m2-app.scss index 243b99800765..cf781eb6fafb 100644 --- a/src/material/core/_m2-app.scss +++ b/src/material/core/_m2-app.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use './theming/inspection'; @use './style/elevation'; @use '../core/tokens/m2-utils'; @@ -19,9 +18,7 @@ ); @for $zValue from 0 through 24 { - $elevation-color: inspection.get-theme-color($theme, foreground, elevation); - $shadow: elevation.get-box-shadow($zValue, - if($elevation-color == null, elevation.$color, $elevation-color)); + $shadow: elevation.get-box-shadow($zValue, map.get($system, shadow)); $tokens: map.set($tokens, 'app-elevation-shadow-level-#{$zValue}', $shadow); } diff --git a/src/material/core/m2/_theming.scss b/src/material/core/m2/_theming.scss index bdd7cff4cc05..854b22a6925d 100644 --- a/src/material/core/m2/_theming.scss +++ b/src/material/core/m2/_theming.scss @@ -135,6 +135,7 @@ hover-state-layer-opacity: 0.04, focus-state-layer-opacity: 0.12, pressed-state-layer-opacity: 0.12, + shadow: black, primary: map.get($primary, default), on-primary: map.get($primary, default-contrast), secondary: map.get($accent, default), @@ -167,6 +168,7 @@ hover-state-layer-opacity: 0.04, focus-state-layer-opacity: 0.12, pressed-state-layer-opacity: 0.12, + shadow: black, primary: map.get($primary, default), on-primary: map.get($primary, default-contrast), secondary: map.get($accent, default), diff --git a/src/material/core/style/BUILD.bazel b/src/material/core/style/BUILD.bazel index 663f7ffff165..906d6af56d3e 100644 --- a/src/material/core/style/BUILD.bazel +++ b/src/material/core/style/BUILD.bazel @@ -57,6 +57,7 @@ sass_library( deps = [ ":elevation", "//src/material/core/theming:_inspection", + "//src/material/core/tokens:m2_utils", ], ) diff --git a/src/material/core/style/_private.scss b/src/material/core/style/_private.scss index 026717998738..9274ce8365be 100644 --- a/src/material/core/style/_private.scss +++ b/src/material/core/style/_private.scss @@ -1,18 +1,15 @@ @use './elevation'; -@use '../theming/inspection'; +@use '../tokens/m2-utils'; +@use 'sass:map'; @mixin private-theme-elevation($zValue, $theme) { - $elevation-color: inspection.get-theme-color($theme, foreground, elevation); - $elevation-color-or-default: if($elevation-color == null, elevation.$color, $elevation-color); - - @include elevation.elevation($zValue, $elevation-color-or-default); + $system: m2-utils.get-system($theme); + @include elevation.elevation($zValue, map.get($system, shadow)); } @mixin private-theme-overridable-elevation($zValue, $theme) { - $elevation-color: inspection.get-theme-color($theme, foreground, elevation); - $elevation-color-or-default: if($elevation-color == null, elevation.$color, $elevation-color); - - @include elevation.overridable-elevation($zValue, $elevation-color-or-default); + $system: m2-utils.get-system($theme); + @include elevation.overridable-elevation($zValue, map.get($system, shadow)); } // If the mat-animation-noop class is present on the components root element,