Skip to content

Commit fd0d967

Browse files
committed
refactor: converge remaining secondary text to on-surface-variant
1 parent a62164d commit fd0d967

File tree

8 files changed

+29
-37
lines changed

8 files changed

+29
-37
lines changed

src/material/checkbox/_m2-checkbox.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
$palette-default: inspection.get-theme-color($theme, $palette-name, default);
3030
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
3131
$palette-selected: inspection.get-theme-color($theme, $palette-name);
32-
$border-color: inspection.get-theme-color($theme, foreground, base, 0.54);
3332
$selected-checkmark-color:
3433
inspection.get-theme-color($theme, $palette-name, default-contrast);
3534

@@ -45,7 +44,7 @@
4544
checkbox-selected-pressed-icon-color: $palette-selected,
4645
checkbox-unselected-focus-icon-color: map.get($system, on-surface),
4746
checkbox-unselected-hover-icon-color: map.get($system, on-surface),
48-
checkbox-unselected-icon-color: $border-color,
47+
checkbox-unselected-icon-color: map.get($system, on-surface-variant),
4948
checkbox-selected-focus-state-layer-color: $palette-default,
5049
checkbox-selected-hover-state-layer-color: $palette-default,
5150
checkbox-selected-pressed-state-layer-color: $palette-default,

src/material/datepicker/_m2-datepicker.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ $private-default-overlap-color: #a8dab5;
7070
}
7171

7272
@return sass-utils.merge-all($calendar-tokens, $toggle-tokens, $range-tokens, (
73-
datepicker-toggle-icon-color: $inactive-icon-color,
73+
datepicker-toggle-icon-color: map.get($system, on-surface-variant),
7474
datepicker-calendar-body-label-text-color: map.get($system, on-surface-variant),
7575
datepicker-calendar-period-button-text-color:
7676
inspection.get-theme-color($theme, foreground, base),
77-
datepicker-calendar-period-button-icon-color: $inactive-icon-color,
78-
datepicker-calendar-navigation-button-icon-color: $inactive-icon-color,
77+
datepicker-calendar-period-button-icon-color: map.get($system, on-surface-variant),
78+
datepicker-calendar-navigation-button-icon-color: map.get($system, on-surface-variant),
7979
datepicker-calendar-header-divider-color: map.get($system, outline),
8080
datepicker-calendar-header-text-color: map.get($system, on-surface-variant),
8181

src/material/dialog/_m2-dialog.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@return (
2828
dialog-container-color: inspection.get-theme-color($theme, system, surface),
2929
dialog-subhead-color: inspection.get-theme-color($theme, system, on-surface),
30-
dialog-supporting-text-color: inspection.get-theme-color($theme, foreground, base, 0.6),
30+
dialog-supporting-text-color: inspection.get-theme-color($theme, system, on-surface-variant),
3131
);
3232
}
3333

src/material/form-field/_m2-form-field.scss

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434

3535
@return map.merge($color-tokens, (
3636
// MDC has a token for the enabled placeholder, but not for the disabled one.
37-
form-field-disabled-input-text-placeholder-color:
38-
inspection.get-theme-color($theme, foreground, base, 0.38),
37+
form-field-disabled-input-text-placeholder-color: $disabled,
3938
form-field-state-layer-color: inspection.get-theme-color($theme, system, on-surface),
4039
form-field-error-text-color: inspection.get-theme-color($theme, warn),
4140

@@ -63,52 +62,44 @@
6362
form-field-error-focus-trailing-icon-color: unset,
6463
form-field-error-hover-trailing-icon-color: unset,
6564
form-field-error-trailing-icon-color: unset,
66-
form-field-enabled-select-arrow-color:
67-
inspection.get-theme-color($theme, foreground, base, 0.54),
65+
form-field-enabled-select-arrow-color: map.get($system, on-surface-variant),
6866
form-field-disabled-select-arrow-color: $disabled,
6967
form-field-hover-state-layer-opacity: map.get($system, hover-state-layer-opacity),
7068
form-field-focus-state-layer-opacity: map.get($system, focus-state-layer-opacity),
7169
form-field-filled-container-color: _variable-safe-mix($on-surface, $surface, 4%),
7270
form-field-filled-disabled-container-color: _variable-safe-mix($on-surface, $surface, 2%),
73-
form-field-filled-label-text-color: inspection.get-theme-color($theme, foreground, base, 0.6),
74-
form-field-filled-hover-label-text-color:
75-
inspection.get-theme-color($theme, foreground, base, 0.6),
71+
form-field-filled-label-text-color: map.get($system, on-surface-variant),
72+
form-field-filled-hover-label-text-color: map.get($system, on-surface-variant),
7673
form-field-filled-disabled-label-text-color: $disabled,
77-
form-field-filled-input-text-color:
78-
inspection.get-theme-color($theme, system, on-surface),
74+
form-field-filled-input-text-color: map.get($system, on-surface),
7975
form-field-filled-disabled-input-text-color: $disabled,
80-
form-field-filled-input-text-placeholder-color:
81-
inspection.get-theme-color($theme, foreground, base, 0.6),
76+
form-field-filled-input-text-placeholder-color: map.get($system, on-surface-variant),
8277
form-field-filled-error-hover-label-text-color: $warn-color,
8378
form-field-filled-error-focus-label-text-color: $warn-color,
8479
form-field-filled-error-label-text-color: $warn-color,
8580
form-field-filled-error-caret-color: $warn-color,
86-
form-field-filled-active-indicator-color:
87-
inspection.get-theme-color($theme, foreground, base, 0.42),
81+
form-field-filled-active-indicator-color: map.get($system, on-surface-variant),
8882
form-field-filled-disabled-active-indicator-color:
8983
inspection.get-theme-color($theme, foreground, base, 0.06),
9084
form-field-filled-hover-active-indicator-color:
9185
inspection.get-theme-color($theme, system, on-surface),
9286
form-field-filled-error-active-indicator-color: $warn-color,
9387
form-field-filled-error-focus-active-indicator-color: $warn-color,
9488
form-field-filled-error-hover-active-indicator-color: $warn-color,
95-
form-field-outlined-label-text-color:
96-
inspection.get-theme-color($theme, foreground, base, 0.6),
97-
form-field-outlined-hover-label-text-color:
98-
inspection.get-theme-color($theme, foreground, base, 0.6),
89+
form-field-outlined-label-text-color: map.get($system, on-surface-variant),
90+
form-field-outlined-hover-label-text-color: map.get($system, on-surface),
9991
form-field-outlined-disabled-label-text-color: $disabled,
10092
form-field-outlined-input-text-color:
10193
inspection.get-theme-color($theme, system, on-surface),
10294
form-field-outlined-disabled-input-text-color: $disabled,
103-
form-field-outlined-input-text-placeholder-color:
104-
inspection.get-theme-color($theme, foreground, base, 0.6),
95+
form-field-outlined-input-text-placeholder-color: map.get($system, on-surface-variant),
10596
form-field-outlined-error-caret-color: $warn-color,
10697
form-field-outlined-error-focus-label-text-color: $warn-color,
10798
form-field-outlined-error-label-text-color: $warn-color,
10899
form-field-outlined-error-hover-label-text-color: $warn-color,
109-
form-field-outlined-outline-color: inspection.get-theme-color($theme, foreground, base, 0.38),
100+
form-field-outlined-outline-color: map.get($system, outline),
110101
form-field-outlined-disabled-outline-color:
111-
inspection.get-theme-color($theme, foreground, base, 0.06),
102+
m3-utils.color-with-opacity(map.get($system, on-surface), 12%),
112103
form-field-outlined-hover-outline-color:
113104
inspection.get-theme-color($theme, system, on-surface),
114105
form-field-outlined-error-focus-outline-color: $warn-color,

src/material/list/_m2-list.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
list-list-item-label-text-color: map.get($system, on-surface),
3737
list-list-item-supporting-text-color: map.get($system, on-surface-variant),
3838
list-list-item-leading-icon-color: $text-icon-on-background,
39-
list-list-item-trailing-supporting-text-color:
40-
inspection.get-theme-color($theme, foreground, hint-text),
39+
list-list-item-trailing-supporting-text-color: map.get($system, on-surface-variant),
4140
list-list-item-trailing-icon-color: $text-icon-on-background,
4241
list-list-item-selected-trailing-icon-color: $text-icon-on-background,
4342
list-list-item-disabled-label-text-color: map.get($system, on-surface),

src/material/paginator/_m2-paginator.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@use 'sass:map';
33
@use '../core/theming/theming';
44
@use '../core/theming/inspection';
5+
@use '../core/tokens/m2-utils';
56

67
// Tokens that can't be configured through Angular Material's current theming API,
78
// but may be in a future version of the theming API.
@@ -11,10 +12,12 @@
1112

1213
// Tokens that can be configured through Angular Material's color theming API.
1314
@function get-color-tokens($theme) {
15+
$system: m2-utils.get-system($theme);
16+
1417
@return (
15-
paginator-container-text-color: inspection.get-theme-color($theme, system, on-surface),
16-
paginator-container-background-color: inspection.get-theme-color($theme, system, surface),
17-
paginator-enabled-icon-color: inspection.get-theme-color($theme, foreground, base, 0.54),
18+
paginator-container-text-color: map.get($system, on-surface),
19+
paginator-container-background-color: map.get($system, surface),
20+
paginator-enabled-icon-color: map.get($system, on-surface-variant),
1821
paginator-disabled-icon-color: inspection.get-theme-color($theme, foreground, base, 0.12),
1922
);
2023
}

src/material/radio/_m2-radio.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
radio-selected-pressed-icon-color: $palette-color,
3838
radio-unselected-focus-icon-color: map.get($system, on-surface),
3939
radio-unselected-hover-icon-color: map.get($system, on-surface),
40-
radio-unselected-icon-color: inspection.get-theme-color($theme, foreground, base, 0.54),
40+
radio-unselected-icon-color: map.get($system, on-surface-variant),
4141
radio-unselected-pressed-icon-color: map.get($system, on-surface),
4242
);
4343
}

src/material/select/_m2-select.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
$disabled: m3-utils.color-with-opacity(map.get($system, on-surface), 38%);
2020

2121
@return (
22-
select-panel-background-color: inspection.get-theme-color($theme, system, surface),
23-
select-enabled-trigger-text-color: inspection.get-theme-color($theme, system, on-surface),
22+
select-panel-background-color: map.get($system, surface),
23+
select-enabled-trigger-text-color: map.get($system, on-surface),
2424
select-disabled-trigger-text-color: $disabled,
25-
select-placeholder-text-color: inspection.get-theme-color($theme, foreground, base, 0.6),
26-
select-enabled-arrow-color: inspection.get-theme-color($theme, foreground, base, 0.54),
25+
select-placeholder-text-color: map.get($system, on-surface-variant),
26+
select-enabled-arrow-color: map.get($system, on-surface-variant),
2727
select-disabled-arrow-color: $disabled,
2828
select-focused-arrow-color: inspection.get-theme-color($theme, $palette-name, default, 0.87),
2929
select-invalid-arrow-color: inspection.get-theme-color($theme, warn, default, 0.87),

0 commit comments

Comments
 (0)