Skip to content

Commit f521a58

Browse files
andrewseguinAndrew Seguin
andauthored
refactor: realign changes with g3 (#31353)
Co-authored-by: Andrew Seguin <[email protected]>
1 parent f26ff4e commit f521a58

File tree

2 files changed

+34
-29
lines changed

2 files changed

+34
-29
lines changed

src/material/core/tokens/m2/_md-sys-typescale.scss

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,44 @@
33
@use 'sass:meta';
44

55
@function md-sys-typescale-values($config) {
6+
// Mapping is according to the old 2014 version of the typography spec.
67
$sys-to-config: (
7-
body-large: body-1,
8-
body-medium: body-2,
8+
body-large: subheading-1,
9+
body-medium: body-1,
910
body-small: caption,
10-
label-large: subtitle-1,
11-
label-medium: subtitle-2,
11+
display-large: display-4,
12+
display-medium: display-4,
13+
display-small: display-4,
14+
headline-large: display-3,
15+
headline-medium: display-2,
16+
headline-small: display-1,
17+
label-large: subheading-2,
18+
label-medium: body-2,
1219
label-small: button,
13-
display-large: headline-1,
14-
display-medium: headline-1,
15-
display-small: headline-1,
16-
headline-large: headline-2,
17-
headline-medium: headline-3,
18-
headline-small: headline-4,
19-
title-large: headline-5,
20-
title-medium: headline-5,
21-
title-small: headline-6,
20+
title-large: headline,
21+
title-medium: headline,
22+
title-small: title,
2223
);
2324

24-
// If the config is based on an old 2014 version of the typography spec, then
25-
// use the old config keys to map to the new system tokens.
26-
@if (map.get($config, headline) != null) {
25+
// If the config is based on the updated 2018 version of the typography spec, then
26+
// use the correct config keys mapping.
27+
@if (map.get($config, headline-1) != null) {
2728
$sys-to-config: (
28-
body-large: subheading-1,
29-
body-medium: body-1,
29+
body-large: body-1,
30+
body-medium: body-2,
3031
body-small: caption,
31-
display-large: display-4,
32-
display-medium: display-4,
33-
display-small: display-4,
34-
headline-large: display-3,
35-
headline-medium: display-2,
36-
headline-small: display-1,
37-
label-large: subheading-2,
38-
label-medium: body-2,
32+
label-large: subtitle-1,
33+
label-medium: subtitle-2,
3934
label-small: button,
40-
title-large: headline,
41-
title-medium: headline,
42-
title-small: title,
35+
display-large: headline-1,
36+
display-medium: headline-1,
37+
display-small: headline-1,
38+
headline-large: headline-2,
39+
headline-medium: headline-3,
40+
headline-small: headline-4,
41+
title-large: headline-5,
42+
title-medium: headline-5,
43+
title-small: headline-6,
4344
);
4445
}
4546

src/material/slide-toggle/_slide-toggle-theme.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
$system: m2-utils.get-system($theme);
4545

4646
& {
47+
// TODO(andrewjs): Remove this once all tokens are migrated to
48+
// mat internally.
49+
--mdc-slide-toggle-disabled-label-text-color: #{
50+
m3-utils.color-with-opacity(map.get($system, on-surface), 38%)};
4751
// TODO(wagnermaciel): Use our token system to define this css variable.
4852
--mat-slide-toggle-disabled-label-text-color: #{
4953
m3-utils.color-with-opacity(map.get($system, on-surface), 38%)};

0 commit comments

Comments
 (0)