Skip to content

Commit 23cdb79

Browse files
author
Andrew Seguin
committed
fix(material/sort): simplify m2 sort color
1 parent fc36e66 commit 23cdb79

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

src/material/sort/_m2-sort.scss

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,8 @@
1212

1313
// Tokens that can be configured through Angular Material's color theming API.
1414
@function get-color-tokens($theme) {
15-
$table-background: inspection.get-theme-color($theme, background, card);
16-
$text-color: inspection.get-theme-color($theme, foreground, secondary-text);
17-
$arrow-color: null;
18-
19-
// Because the arrow is made up of multiple elements that are stacked on top of each other,
20-
// we can't use the semi-transparent color from the theme directly. If the value is a color
21-
// *type*, we convert it into a solid color by taking the opacity from the rgba value and
22-
// using the value to determine the percentage of the background to put into foreground
23-
// when mixing the colors together. Otherwise, if it resolves to something different
24-
// (e.g. it resolves to a CSS variable), we use the color directly.
25-
@if (meta.type-of($table-background) == color and meta.type-of($text-color) == color) {
26-
$text-opacity: color.opacity($text-color);
27-
$arrow-color: color.mix($table-background, rgba($text-color, 1), (1 - $text-opacity) * 100%);
28-
}
29-
@else {
30-
$arrow-color: $text-color;
31-
}
32-
3315
@return (
34-
sort-arrow-color: $arrow-color,
16+
sort-arrow-color: inspection.get-theme-color($theme, foreground, text),
3517
);
3618
}
3719

0 commit comments

Comments
 (0)