From 8ea145c5b9a14e9a4a4813c0134bc3cc4e87a990 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Tue, 23 Apr 2024 10:40:12 -0400 Subject: [PATCH] fix(material/theming): simplify color combination --- src/material/core/style/_sass-utils.scss | 2 +- src/material/core/tokens/_m3-tokens.scss | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/material/core/style/_sass-utils.scss b/src/material/core/style/_sass-utils.scss index 2168ff901136..a60709936250 100644 --- a/src/material/core/style/_sass-utils.scss +++ b/src/material/core/style/_sass-utils.scss @@ -62,7 +62,7 @@ @return color.change($color, $args...); } @else if ($color != null and map.get($args, alpha) != null) { - @return #{color(from #{$color} srgb r g b / #{map.get($args, alpha)})}; + @return rgba($color, map.get($args, alpha)); } @return $color; } diff --git a/src/material/core/tokens/_m3-tokens.scss b/src/material/core/tokens/_m3-tokens.scss index 1f8510d7324c..5b4ad7704c85 100644 --- a/src/material/core/tokens/_m3-tokens.scss +++ b/src/material/core/tokens/_m3-tokens.scss @@ -164,14 +164,10 @@ $color: map.get($tokens, $color-key); $opacity: map.get($opacity-lookup, $opacity-key); - @if(meta.type-of($color) == 'color') { + @if($color != null) { $result: map.remove($result, $opacity-key); $result: map.set($result, $color-key, rgba($color, $opacity)); } - @else if($color != null) { - $result: map.remove($result, $opacity-key); - $result: map.set($result, $color-key, #{color(from #{$color} srgb r g b / #{$opacity})}); - } } @return $result;