Skip to content

Commit b7e5f22

Browse files
committed
Fix date picker color. Cleanup some code.
1 parent a0444d2 commit b7e5f22

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

projects/material-css-vars/src/lib/_main.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
@import 'variables';
44
@import 'internal-helper';
55
@import 'public-util';
6-
// contains main overwrite of `mat-color` to make it all work
7-
// needs to come after '~@angular/material/theming'
86
@import 'mat-lib-overwrites';
97

108
@mixin init-css-vars($default-theme, $text) {

projects/material-css-vars/src/lib/_mat-lib-overwrites.scss

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
@use '@angular/material'as mat;
21
@import 'public-util';
32

4-
// apply additional overwrites
3+
// ---------------------------
4+
// MDC Overwrites
5+
// ---------------------------
56
@mixin mat-css-other-overwrites {
67
@include _mat-mdc-fab-overwrites();
78
@include _mat-mdc-button-overwrites();
89
@include _mat-mdc-text-field-overwrites();
910
@include _mat-mdc-slide-toggle-overwrites();
1011
@include _mat-mdc-select-overwrites();
1112
@include _mat-mdc-checkbox-overwrites();
12-
@include _mat-mdc-date-picker-overwrites();
1313
@include _mat-mdc-chips-overwrites();
14+
@include _mat-mdc-date-picker-overwrites();
1415
}
1516

1617
// ---------------------------
@@ -66,13 +67,11 @@
6667
--mat-mdc-button-ripple-color: #{mat-css-color(500, 0.1, "primary")};
6768
}
6869
}
69-
7070
&.mat-accent {
7171
@include mat-css-light-dark-theme-global() {
7272
--mat-mdc-button-ripple-color: #{mat-css-color(500, 0.1, "accent")};
7373
}
7474
}
75-
7675
&.mat-warn {
7776
@include mat-css-light-dark-theme-global() {
7877
--mat-mdc-button-ripple-color: #{mat-css-color(500, 0.1, "warn")};
@@ -88,14 +87,12 @@
8887
--mdc-protected-button-label-text-color: #{$color-primary};
8988
}
9089
}
91-
9290
&.mat-accent {
9391
@include mat-css-light-dark-theme-global() {
9492
--mdc-filled-button-label-text-color: #{$color-accent};
9593
--mdc-protected-button-label-text-color: #{$color-accent};
9694
}
9795
}
98-
9996
&.mat-warn {
10097
@include mat-css-light-dark-theme-global() {
10198
--mdc-filled-button-label-text-color: #{$color-warn};
@@ -251,6 +248,20 @@
251248
}
252249
}
253250

251+
// ---------------------------
252+
// CHIPS component
253+
// ---------------------------
254+
@mixin _mat-mdc-chips-overwrites {
255+
.mat-mdc-standard-chip {
256+
@include mat-css-dark-theme-global() {
257+
--mdc-chip-elevated-container-color: #{map-get($mat-css-palette-background-dark, "unselected-chip")};
258+
}
259+
@include mat-css-light-theme-global() {
260+
--mdc-chip-elevated-container-color: #{map-get($mat-css-palette-background, "unselected-chip")};
261+
}
262+
}
263+
}
264+
254265
// ---------------------------
255266
// DATE PICKER component
256267
// ---------------------------
@@ -275,21 +286,10 @@
275286
}
276287
}
277288
.mat-calendar-body-cell:not(.mat-calendar-body-disabled).mat-calendar-body-active > .mat-calendar-body-today {
278-
color: mat-css-contrast-color-primary(500);
289+
color: mat-css-color(500, null, $palette, true);
279290
}
280291
.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover
281292
> .mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical) {
282293
background: mat-css-color(500, 0.3, $palette);
283294
}
284-
}
285-
286-
@mixin _mat-mdc-chips-overwrites {
287-
.mat-mdc-standard-chip {
288-
@include mat-css-dark-theme-global() {
289-
--mdc-chip-elevated-container-color: #{map-get($mat-css-palette-background-dark, "unselected-chip")};
290-
}
291-
@include mat-css-light-theme-global() {
292-
--mdc-chip-elevated-container-color: #{map-get($mat-css-palette-background, "unselected-chip")};
293-
}
294-
}
295295
}

0 commit comments

Comments
 (0)