Skip to content

Commit b8fe12b

Browse files
authored
Migrate MDC tokens to Angular Material 20 system tokens (#2391)
1 parent a3d11ab commit b8fe12b

File tree

12 files changed

+81
-47
lines changed

12 files changed

+81
-47
lines changed

web/src/app/components/create-survey/create-survey.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</div>
2525
</div>
2626

27+
<div class="container">
2728
<div class="card">
2829
<img
2930
*ngIf="createSurveyPhase === CreateSurveyPhase.JOB_DETAILS"
@@ -110,4 +111,5 @@
110111
</button>
111112
</div>
112113
</div>
114+
</div>
113115
</div>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Copyright 2026 The Ground Authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the 'License');
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an 'AS IS' BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
@use 'sass:map';
18+
@use '@angular/material' as mat;
19+
20+
@mixin color($theme) {
21+
.data-sharing-terms {
22+
.mat-mdc-card {
23+
--mat-card-elevated-container-elevation: 0;
24+
--mat-card-elevated-container-color: #fcfdf7;
25+
26+
border: 1px solid mat.get-theme-color($theme, neutral, 90);
27+
}
28+
}
29+
}
30+
31+
@mixin theme($theme) {
32+
@include color($theme);
33+
}

web/src/app/components/edit-survey/_edit-survey.component-theme.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424

2525
.survey-details-container, .share-survey-container {
2626
.mat-mdc-card {
27-
--mdc-elevated-card-container-elevation: 0;
27+
--mat-card-elevated-container-elevation: 0;
28+
--mat-card-elevated-container-color: #fcfdf7;
29+
2830
border: 1px solid mat.get-theme-color($theme, neutral, 90);
2931
}
3032

3133
.mdc-button {
3234
&.delete-survey-button {
33-
--mdc-outlined-button-label-text-color: #{mat.get-theme-color($theme, error)};
35+
--mat-button-outlined-label-text-color: #{mat.get-theme-color($theme, error)};
3436
}
3537
}
3638
}

web/src/app/components/edit-survey/edit-survey.component.scss

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@
3333
width: 300px;
3434
padding: 12px;
3535

36-
--mdc-list-list-item-label-text-size: 14px;
37-
--mdc-list-list-item-leading-label-color: #444746;
38-
--mdc-list-list-item-hover-label-text-color: #444746;
39-
--mdc-list-list-item-label-icon-size: 14px;
40-
--mdc-list-list-item-leading-icon-color: #444746;
41-
--mdc-list-list-item-hover-leading-icon-color: #444746;
36+
--mat-list-list-item-label-text-size: 14px;
37+
--mat-list-list-item-label-text-color: #444746;
38+
--mat-list-list-item-hover-label-text-color: #444746;
39+
--mat-list-list-item-leading-icon-size: 24px;
40+
--mat-list-list-item-leading-icon-color: #444746;
41+
--mat-list-list-item-hover-leading-icon-color: #444746;
42+
--mat-list-list-item-leading-avatar-color: #444746;
4243

4344
.is-active {
4445
background-color: #dcddd9;

web/src/app/components/main-page-container/main-page/secondary-side-panel/submission-panel/submission-panel.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131

3232
.submission-subtitle {
33-
padding-left: var(--mdc-icon-button-state-layer-size);
33+
padding-left: 40px;
3434
}
3535

3636
.submission-tasks-container {

web/src/app/components/shared/header/_header.component-theme.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
}
1212

1313
.header .cancel-edit-button {
14-
--mdc-text-button-label-text-color: #{mat.get-theme-color($theme, secondary)};
14+
--mat-button-text-label-text-color: #{mat.get-theme-color($theme, secondary)};
1515
}
1616

1717
.header .finish-edit-button {
18-
--mdc-filled-button-container-color: #{mat.get-theme-color($theme, tertiary)};
19-
--mdc-filled-button-label-text-color: #{mat.get-theme-color($theme, on-primary)};
18+
--mat-button-filled-container-color: #{mat.get-theme-color($theme, tertiary)};
19+
--mat-button-filled-label-text-color: #{mat.get-theme-color($theme, on-primary)};
2020
}
2121
}
2222

web/src/app/components/shared/loi-editor/_loi-editor.component-theme.scss

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
@use '@angular/material' as mat;
1919

2020
@mixin color($theme) {
21-
.loi-editor .loi-editor-card .loi-editor-card-row button.import-lois-button {
22-
--mdc-filled-button-container-color: #FFDDAB;
23-
--mdc-filled-button-label-text-color: mat.get-theme-color($theme, on-secondary-container);
21+
.loi-editor .loi-editor-card .loi-editor-card-row button.import-lois-button {
22+
--mat-button-filled-container-color: #FFDDAB;
23+
--mat-button-filled-label-text-color: mat.get-theme-color($theme, on-secondary-container);
2424
}
2525
}
2626

2727
@mixin typography($theme) {
28-
.loi-editor-card-row-title {
29-
font: mat.get-theme-typography($theme, title-medium, font);
30-
}
31-
.loi-editor-card-row-subtitle {
32-
font: mat.get-theme-typography($theme, body-medium, font);
33-
}
28+
.loi-editor-card-row-title {
29+
font: mat.get-theme-typography($theme, title-medium, font);
30+
}
31+
.loi-editor-card-row-subtitle {
32+
font: mat.get-theme-typography($theme, body-medium, font);
33+
}
3434
}
3535

3636
@mixin theme($theme) {
37-
@include color($theme);
38-
@include typography($theme);
37+
@include color($theme);
38+
@include typography($theme);
3939
}

web/src/app/components/shared/loi-editor/loi-editor.component.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,9 @@
5050
align-items: center;
5151
justify-content: flex-end;
5252
}
53-
54-
button.import-lois-button {
55-
--mdc-filled-button-container-shape: 24px;
56-
}
5753

5854
button.clear-all-lois {
5955
border: 1px solid #727970;
60-
--mdc-filled-button-container-shape: 24px;
6156
}
6257
}
6358
}

web/src/app/components/shared/share-list/share-list.component.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
.share-list-container {
1818
.mat-mdc-list-item {
19-
--mdc-list-list-item-one-line-container-height: 48px;
20-
--mdc-list-list-item-trailing-supporting-text-size: 16px;
2119
padding: 0;
2220
}
2321

web/src/app/components/shared/share-survey/_share-survey.component-theme.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
@mixin color($theme) {
2121
.share-survey-container {
2222
.mat-mdc-card {
23-
--mdc-elevated-card-container-elevation: 0;
23+
--mat-card-elevated-container-elevation: 0;
24+
--mat-card-elevated-container-color: #fcfdf7;
25+
2426
border: 1px solid mat.get-theme-color($theme, neutral, 90);
2527

2628
.mat-mdc-card-content {
@@ -30,8 +32,8 @@
3032

3133
.mdc-button {
3234
&.share-survey-button {
33-
--mdc-filled-button-container-color: transparent;
34-
--mdc-filled-button-label-text-color: #{mat.get-theme-color($theme, error)};
35+
--mat-filled-button-container-color: transparent;
36+
--mat-filled-button-label-text-color: #{mat.get-theme-color($theme, error)};
3537
background-color: mat.get-theme-color($theme, secondary-container);
3638
color: mat.get-theme-color($theme, on-secondary-container);
3739
}

0 commit comments

Comments
 (0)