66$mat-chip-font-size : 13px ;
77$mat-chip-line-height : 16px ;
88
9+ @mixin mat-chips-theme-color ($color ) {
10+ @include mat-chips-color (mat-contrast ($color , 500 ), mat-color ($color , 500 ));
11+ }
12+
13+ @mixin mat-chips-color ($foreground , $background ) {
14+ background-color : $background ;
15+ color : $foreground ;
16+
17+ .mat-chip-remove {
18+ color : $foreground ;
19+ opacity : 0.4 ;
20+ }
21+
22+ .mat-chip-remove :hover {
23+ opacity : 0.54 ;
24+ }
25+ }
926
1027@mixin mat-chips-theme ($theme ) {
1128 $is-dark-theme : map-get ($theme , is-dark );
@@ -30,9 +47,8 @@ $mat-chip-line-height: 16px;
3047
3148 $focus-color : mat-color ($foreground , secondary-text );
3249
33- .mat-chip :not (.mat-basic-chip ) {
34- background-color : $unselected-background ;
35- color : $unselected-foreground ;
50+ .mat-chip {
51+ @include mat-chips-color ($unselected-foreground , $unselected-background );
3652
3753 .mat-chip-focus-border {
3854 pointer-events : none ;
@@ -42,87 +58,27 @@ $mat-chip-line-height: 16px;
4258 outline : none ;
4359 border : 2px solid $focus-color ;
4460 }
45-
46- .mat-chip-remove {
47- color : $unselected-foreground ;
48- opacity : 0.3 ;
49- }
50-
51- .mat-chip-remove :hover {
52- opacity : 0.54 ;
53- }
5461 }
5562
56- .mat-chip.mat-chip-selected :not (.mat-basic-chip ) {
57- background-color : $selected-background ;
58- color : $selected-foreground ;
59-
60- .mat-chip-remove {
61- color : $selected-foreground ;
62- opacity : 0.4 ;
63- }
64-
65- .mat-chip-remove :hover {
66- opacity : 0.54 ;
67- }
63+ .mat-chip.mat-chip-selected {
64+ @include mat-chips-color ($selected-foreground , $selected-background );
6865
6966 & .mat-primary {
70- background-color : mat-color ($primary );
71- color : mat-color ($primary , default-contrast );
72- }
73-
74- & .mat-accent {
75- background-color : mat-color ($accent );
76- color : mat-color ($accent , default-contrast );
67+ @include mat-chips-theme-color ($primary );
7768 }
7869
7970 & .mat-warn {
80- background-color : mat-color ($warn );
81- color : mat-color ($warn , default-contrast );
82-
83- .mat-chip-remove {
84- color : mat-contrast ($primary , 500 );
85- opacity : 0.4 ;
86- }
87-
88- .mat-chip-remove :hover {
89- opacity : 0.54 ;
90- }
91-
71+ @include mat-chips-theme-color ($warn );
9272 }
9373
9474 & .mat-accent {
95- background-color : mat-color ($accent , 500 );
96- color : mat-contrast ($accent , 500 );
97-
98- .mat-chip-remove {
99- color : mat-contrast ($accent , 500 );
100- opacity : 0.4 ;
101- }
102-
103- .mat-chip-remove :hover {
104- opacity : 0.54 ;
105- }
106- }
107-
108- & .mat-warn {
109- background-color : mat-color ($warn , 500 );
110- color : mat-contrast ($warn , 500 );
111-
112- .mat-chip-remove {
113- color : mat-contrast ($warn , 500 );
114- opacity : 0.4 ;
115- }
116-
117- .mat-chip-remove :hover {
118- opacity : 0.54 ;
119- }
75+ @include mat-chips-theme-color ($accent );
12076 }
12177 }
12278}
12379
12480@mixin mat-chips-typography ($config ) {
125- .mat-chip :not ( .mat-basic-chip ) {
81+ .mat-chip {
12682 font-size : $mat-chip-font-size ;
12783 line-height : $mat-chip-line-height ;
12884 }
0 commit comments