Skip to content

Commit

Permalink
fix(material/theming): simplify color combination
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnermaciel committed Apr 23, 2024
1 parent 4719da2 commit 8ea145c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/material/core/style/_sass-utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 1 addition & 5 deletions src/material/core/tokens/_m3-tokens.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8ea145c

Please sign in to comment.