Content-Length: 310141 | pFad | http://github.com/angular/components/commit/d22191a61907bff5d01c1278a38382af5236f7c2

0F fix(material/sort): simplify m2 sort color (#31165) · angular/components@d22191a · GitHub
Skip to content

Commit d22191a

Browse files
andrewseguinAndrew Seguin
and
Andrew Seguin
authored
fix(material/sort): simplify m2 sort color (#31165)
* fix(material/sort): simplify m2 sort color * fix(material/sort): lint # Conflicts: # src/material/sort/_m2-sort.scss --------- Co-authored-by: Andrew Seguin <andrewseguin@google.com>
1 parent 27b79b4 commit d22191a

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/material/sort/_m2-sort.scss

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@use 'sass:color';
2-
@use 'sass:meta';
31
@use '../core/theming/inspection';
42

53
// Tokens that can't be configured through Angular Material's current theming API,
@@ -10,26 +8,8 @@
108

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

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/components/commit/d22191a61907bff5d01c1278a38382af5236f7c2

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy