Skip to content

Commit ec66685

Browse files
andrewseguinAndrew Seguin
and
Andrew Seguin
authored
refactor: switch m2 from palette divider to system outline (#31200)
Co-authored-by: Andrew Seguin <andrewseguin@google.com>
1 parent e78a0a3 commit ec66685

File tree

13 files changed

+16
-16
lines changed

13 files changed

+16
-16
lines changed

src/material-experimental/column-resize/_column-resize-theme.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use '@angular/material' as mat;
22

33
@mixin color($theme) {
4-
$non-resizable-hover-divider: mat.get-theme-color($theme, foreground, divider);
54
$resizable-hover-divider: mat.get-theme-color($theme, primary, 600);
65
$resizable-active-divider: mat.get-theme-color($theme, primary, 600);
76

@@ -65,15 +64,15 @@
6564

6665
.mat-header-cell:not(.mat-resizable)::after,
6766
.mat-mdc-header-cell:not(.mat-resizable)::after {
68-
background: $non-resizable-hover-divider;
67+
background: mat.get-theme-color($theme, system, outline);
6968
}
7069

7170
.mat-resizable-handle {
7271
background: $resizable-hover-divider;
7372
}
7473

7574
.cdk-resizable-resize-disabled > .mat-resizable-handle {
76-
background: $non-resizable-hover-divider;
75+
background: mat.get-theme-color($theme, system, outline);
7776
}
7877
}
7978

src/material/button-toggle/_m2-button-toggle.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// Tokens that can be configured through Angular Material's color theming API.
2121
@function get-color-tokens($theme) {
22-
$theme-divider-color: inspection.get-theme-color($theme, foreground, divider);
22+
$theme-divider-color: inspection.get-theme-color($theme, system, outline);
2323

2424
// By default the theme usually has an rgba color for the dividers, which can
2525
// stack up with the background of a button toggle. This can cause the border

src/material/button/_m2-button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// internally. For now we fall back to the old hardcoded behavior only for internal apps.
4949
$outline: if(m2-utils.$private-is-internal-build,
5050
rgba(if($is-dark, #fff, #000), 0.12),
51-
inspection.get-theme-color($theme, foreground, divider)
51+
inspection.get-theme-color($theme, system, outline)
5252
);
5353

5454
@return (

src/material/core/m2/_theming.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@
124124
system: (
125125
surface: white,
126126
on-surface: rgba(black, 0.87),
127+
outline: rgba(black, 0.12),
127128
),
128129
);
129130
}
@@ -141,6 +142,7 @@
141142
system: (
142143
surface: map.get(palette.$grey-palette, 800),
143144
on-surface: white,
145+
outline: rgba(white, 0.12),
144146
),
145147
);
146148
}

src/material/datepicker/_m2-datepicker.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ $private-default-overlap-color: #a8dab5;
4141
$text-color: inspection.get-theme-color($theme, system, on-surface);
4242
$secondary-text-color: inspection.get-theme-color($theme, foreground, secondary-text);
4343
$disabled-text-color: inspection.get-theme-color($theme, foreground, disabled-text);
44-
$divider-color: inspection.get-theme-color($theme, foreground, divider);
4544
$hint-text-color: inspection.get-theme-color($theme, foreground, hint-text);
46-
$preview-outline-color: $divider-color;
45+
$preview-outline-color: inspection.get-theme-color($theme, system, outline);
4746
$today-disabled-outline-color: null;
4847
$is-dark: inspection.get-theme-type($theme) == dark;
4948

@@ -74,7 +73,7 @@ $private-default-overlap-color: #a8dab5;
7473
inspection.get-theme-color($theme, foreground, text, 1),
7574
datepicker-calendar-period-button-icon-color: $inactive-icon-color,
7675
datepicker-calendar-navigation-button-icon-color: $inactive-icon-color,
77-
datepicker-calendar-header-divider-color: $divider-color,
76+
datepicker-calendar-header-divider-color: inspection.get-theme-color($theme, system, outline),
7877
datepicker-calendar-header-text-color: $secondary-text-color,
7978

8079
// Note: though it's not text, the border is a hint about the fact

src/material/divider/_m2-divider.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Tokens that can be configured through Angular Material's color theming API.
1212
@function get-color-tokens($theme) {
1313
@return (
14-
divider-color: inspection.get-theme-color($theme, foreground, divider)
14+
divider-color: inspection.get-theme-color($theme, system, outline)
1515
);
1616
}
1717

src/material/expansion/_m2-expansion.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@return (
1818
expansion-container-background-color: inspection.get-theme-color($theme, system, surface),
1919
expansion-container-text-color: inspection.get-theme-color($theme, system, on-surface),
20-
expansion-actions-divider-color: inspection.get-theme-color($theme, foreground, divider),
20+
expansion-actions-divider-color: inspection.get-theme-color($theme, system, outline),
2121
expansion-header-hover-state-layer-color: inspection.get-theme-color($theme, background, hover),
2222
expansion-header-focus-state-layer-color: inspection.get-theme-color($theme, background, hover),
2323
expansion-header-disabled-state-text-color: inspection.get-theme-color(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
$disabled-text-color-base: if(m2-utils.$private-is-internal-build, $on-surface,
3838
inspection.get-theme-color($theme, foreground, disabled-text, 1));
3939
$divider-base: if(m2-utils.$private-is-internal-build, $on-surface,
40-
inspection.get-theme-color($theme, foreground, divider, 1));
40+
inspection.get-theme-color($theme, foreground, base));
4141

4242
@return map.merge($color-tokens, (
4343
// MDC has a token for the enabled placeholder, but not for the disabled one.

src/material/menu/_m2-menu.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
menu-item-hover-state-layer-color: $active-state-layer-color,
3535
menu-item-focus-state-layer-color: $active-state-layer-color,
3636
menu-container-color: inspection.get-theme-color($theme, system, surface),
37-
menu-divider-color: inspection.get-theme-color($theme, foreground, divider),
37+
menu-divider-color: inspection.get-theme-color($theme, system, outline),
3838
);
3939
}
4040

src/material/select/_m2-select.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
$disabled-text-color-base: if(m2-utils.$private-is-internal-build, $on-surface,
2626
inspection.get-theme-color($theme, foreground, disabled-text, 1));
2727
$icon-color-base: if(m2-utils.$private-is-internal-build, $on-surface,
28-
inspection.get-theme-color($theme, foreground, divider, 1));
28+
inspection.get-theme-color($theme, foreground, base));
2929

3030
@return (
3131
select-panel-background-color: inspection.get-theme-color($theme, system, surface),

src/material/sidenav/_m2-sidenav.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
$fallback-scrim-color: if($is-dark, rgba(#fff, $scrim-opacity), rgba(#000, $scrim-opacity));
2626

2727
@return (
28-
sidenav-container-divider-color: inspection.get-theme-color($theme, foreground, divider),
28+
sidenav-container-divider-color: inspection.get-theme-color($theme, system, outline),
2929
sidenav-container-background-color: inspection.get-theme-color($theme, system, surface),
3030
sidenav-container-text-color: inspection.get-theme-color($theme, system, on-surface),
3131
sidenav-content-background-color: inspection.get-theme-color($theme, background, background),

src/material/stepper/_m2-stepper.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@function get-color-tokens($theme) {
1616
@return map.merge(private-get-color-palette-color-tokens($theme, primary), (
1717
stepper-container-color: inspection.get-theme-color($theme, system, surface),
18-
stepper-line-color: inspection.get-theme-color($theme, foreground, divider),
18+
stepper-line-color: inspection.get-theme-color($theme, system, outline),
1919
stepper-header-hover-state-layer-color: inspection.get-theme-color($theme, background, hover),
2020
stepper-header-focus-state-layer-color: inspection.get-theme-color($theme, background, hover),
2121
stepper-header-label-text-color: inspection.get-theme-color($theme, foreground, secondary-text),

src/material/table/_m2-table.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
table-header-headline-color: inspection.get-theme-color($theme, system, on-surface),
1919
table-row-item-label-text-color: inspection.get-theme-color($theme, system, on-surface),
20-
table-row-item-outline-color: inspection.get-theme-color($theme, foreground, divider),
20+
table-row-item-outline-color: inspection.get-theme-color($theme, system, outline),
2121
);
2222
}
2323

0 commit comments

Comments
 (0)