44@use ' ../core/theming/inspection' ;
55@use ' ../core/style/elevation' ;
66@use ' ../core/style/sass-utils' ;
7+ @use ' ../core/tokens/m2-utils' ;
8+ @use ' sass:map' ;
79
810$_selected-fade-amount : 0.6 ;
911$_today-fade-amount : 0.2 ;
@@ -37,12 +39,12 @@ $private-default-overlap-color: #a8dab5;
3739
3840// Tokens that can be configured through Angular Material's color theming API.
3941@function get-color-tokens ($theme ) {
42+ $system : m2-utils .get-system ($theme );
43+
4044 $inactive-icon-color : inspection .get-theme-color ($theme , foreground , icon );
41- $text-color : inspection .get-theme-color ($theme , system , on-surface );
42- $secondary-text-color : inspection .get-theme-color ($theme , foreground , secondary-text );
4345 $disabled-text-color : inspection .get-theme-color ($theme , foreground , disabled-text );
4446 $hint-text-color : inspection .get-theme-color ($theme , foreground , hint-text );
45- $preview-outline-color : inspection .get-theme-color ( $theme , system , outline );
47+ $preview-outline-color : map .get ( $ system , outline );
4648 $today-disabled-outline-color : null;
4749 $is-dark : inspection .get-theme-type ($theme ) == dark ;
4850
@@ -68,30 +70,27 @@ $private-default-overlap-color: #a8dab5;
6870
6971 @return sass-utils .merge-all ($calendar-tokens , $toggle-tokens , $range-tokens , (
7072 datepicker- toggle- icon- color: $inactive-icon-color ,
71- datepicker- calendar- body- label- text- color: $secondary-text-color ,
73+ datepicker- calendar- body- label- text- color: map . get ( $system , on-surface-variant ) ,
7274 datepicker- calendar- period- button- text- color:
7375 inspection .get-theme-color ($theme , foreground , base ),
7476 datepicker- calendar- period- button- icon- color: $inactive-icon-color ,
7577 datepicker- calendar- navigation- button- icon- color: $inactive-icon-color ,
76- datepicker- calendar- header- divider- color: inspection .get-theme-color ( $theme , system , outline ),
77- datepicker- calendar- header- text- color: $secondary-text-color ,
78+ datepicker- calendar- header- divider- color: map .get ( $ system , outline ),
79+ datepicker- calendar- header- text- color: map . get ( $system , on-surface-variant ) ,
7880
7981 // Note: though it's not text, the border is a hint about the fact
8082 // that this is today's date, so we use the hint color.
8183 datepicker- calendar- date- today- outline- color: $hint-text-color ,
8284 datepicker- calendar- date- today- disabled- state- outline- color: $today-disabled-outline-color ,
83- datepicker- calendar- date- text- color: $text-color ,
85+ datepicker- calendar- date- text- color: map . get ( $system , on-surface ) ,
8486 datepicker- calendar- date- outline- color: transparent ,
8587 datepicker- calendar- date- disabled- state- text- color: $disabled-text-color ,
8688 datepicker- calendar- date- preview- state- outline- color: $preview-outline-color ,
87-
88- datepicker- range- input- separator- color: $text-color ,
89+ datepicker- range- input- separator- color: map .get ($system , on-surface ),
8990 datepicker- range- input- disabled- state- separator- color: $disabled-text-color ,
9091 datepicker- range- input- disabled- state- text- color: $disabled-text-color ,
91-
92- datepicker- calendar- container- background- color:
93- inspection .get-theme-color ($theme , system , surface ),
94- datepicker- calendar- container- text- color: $text-color ,
92+ datepicker- calendar- container- background- color: map .get ($system , surface ),
93+ datepicker- calendar- container- text- color: map .get ($system , on-surface ),
9594 ));
9695}
9796
0 commit comments