From df2d0f57a2ef8ff814100240df4e76253fae070e Mon Sep 17 00:00:00 2001 From: Allan Chen Date: Wed, 29 Sep 2021 11:22:26 -0700 Subject: [PATCH] fix(button): misc elevation Sass fixes PiperOrigin-RevId: 399731949 --- components/button/lib/_elevated-button-theme.scss | 3 ++- components/button/lib/_elevation-theme.scss | 5 ++--- components/button/lib/_filled-button-theme.scss | 3 ++- components/button/lib/_tonal-button-theme.scss | 9 ++------- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/components/button/lib/_elevated-button-theme.scss b/components/button/lib/_elevated-button-theme.scss index c347ac181..cc26584f3 100644 --- a/components/button/lib/_elevated-button-theme.scss +++ b/components/button/lib/_elevated-button-theme.scss @@ -6,6 +6,7 @@ @use 'sass:map'; @use '@material/theme/keys'; +@use '@material/theme/theme'; @use '@material/tokens/resolvers'; @use './button-theme'; @use './elevation-theme'; @@ -46,7 +47,7 @@ $light-theme: map.merge( @include theme.validate-theme($light-theme, $theme); $theme: elevation-theme.resolve-theme-elevation-keys( $theme, - $resolvers: $resolvers + $resolver: map.get($resolvers, elevation) ); @include keys.declare-custom-properties($theme, $_custom-property-prefix); } diff --git a/components/button/lib/_elevation-theme.scss b/components/button/lib/_elevation-theme.scss index 0874e312f..44cfe7faf 100644 --- a/components/button/lib/_elevation-theme.scss +++ b/components/button/lib/_elevation-theme.scss @@ -74,11 +74,10 @@ $_selectors: button-theme.$selectors; } @function resolve-theme-elevation-keys($theme, $resolver) { - $elevation-resolver: map.get($resolver, elevation); - $shadow-color: map.get($theme, container-shadow-color); - @if $elevation-resolver == null { + @if $resolver == null { @return $theme; } + $shadow-color: map.get($theme, container-shadow-color); $elevation-keys: ( container-elevation, diff --git a/components/button/lib/_filled-button-theme.scss b/components/button/lib/_filled-button-theme.scss index 633e35e3a..09978531c 100644 --- a/components/button/lib/_filled-button-theme.scss +++ b/components/button/lib/_filled-button-theme.scss @@ -6,6 +6,7 @@ @use 'sass:map'; @use '@material/theme/keys'; +@use '@material/theme/theme'; @use '@material/tokens/resolvers'; @use './button-theme'; @use './elevation-theme'; @@ -46,7 +47,7 @@ $light-theme: map.merge( @include theme.validate-theme($light-theme, $theme); $theme: elevation-theme.resolve-theme-elevation-keys( $theme, - $resolvers: $resolvers + $resolver: map.get($resolvers, elevation) ); @include keys.declare-custom-properties($theme, $_custom-property-prefix); } diff --git a/components/button/lib/_tonal-button-theme.scss b/components/button/lib/_tonal-button-theme.scss index 38548275b..3174f951e 100644 --- a/components/button/lib/_tonal-button-theme.scss +++ b/components/button/lib/_tonal-button-theme.scss @@ -4,14 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - @use 'sass:map'; @use '@material/theme/keys'; +@use '@material/theme/theme'; @use '@material/tokens/resolvers'; @use './button-theme'; @use './elevation-theme'; @@ -52,7 +47,7 @@ $light-theme: map.merge( @include theme.validate-theme($light-theme, $theme); $theme: elevation-theme.resolve-theme-elevation-keys( $theme, - $resolvers: $resolvers + $resolver: map.get($resolvers, elevation) ); @include keys.declare-custom-properties($theme, $_custom-property-prefix); }