-
Notifications
You must be signed in to change notification settings - Fork 6.7k
/
_chips-theme.scss
84 lines (67 loc) · 1.9 KB
/
_chips-theme.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@import '../core/style/elevation';
@import '../core/theming/palette';
@import '../core/theming/theming';
@import '../core/typography/typography-utils';
$mat-chip-remove-font-size: 18px;
@mixin mat-chips-color($foreground, $background) {
background-color: $background;
color: $foreground;
.mat-chip-remove {
color: $foreground;
opacity: 0.4;
}
}
@mixin mat-chips-theme-color($palette) {
@include mat-chips-color(mat-color($palette, default-contrast), mat-color($palette));
.mat-ripple-element {
background: mat-color($palette, default-contrast, 0.1);
}
}
@mixin mat-chips-theme($theme) {
$is-dark-theme: map-get($theme, is-dark);
$primary: map-get($theme, primary);
$accent: map-get($theme, accent);
$warn: map-get($theme, warn);
$background: map-get($theme, background);
$foreground: map-get($theme, foreground);
$unselected-background: mat-color($background, unselected-chip);
$unselected-foreground: mat-color($foreground, text);
.mat-chip.mat-standard-chip {
@include mat-chips-color($unselected-foreground, $unselected-background);
&:not(.mat-chip-disabled) {
&:active {
@include _mat-theme-elevation(3, $theme);
}
.mat-chip-remove:hover {
opacity: 0.54;
}
}
&.mat-chip-disabled {
opacity: 0.4;
}
&::after {
background: map_get($foreground, base);
}
}
.mat-chip.mat-standard-chip.mat-chip-selected {
&.mat-primary {
@include mat-chips-theme-color($primary);
}
&.mat-warn {
@include mat-chips-theme-color($warn);
}
&.mat-accent {
@include mat-chips-theme-color($accent);
}
}
}
@mixin mat-chips-typography($config) {
.mat-chip {
font-size: mat-font-size($config, body-2);
font-weight: mat-font-weight($config, body-2);
.mat-chip-trailing-icon.mat-icon,
.mat-chip-remove.mat-icon {
font-size: $mat-chip-remove-font-size;
}
}
}