Skip to content

Commit c5e4766

Browse files
committed
fix(material-experimental/theming): Update M3 palettes (#28109)
Last time I checked, the M3 theme generator generated the same neutral palette regardless of the primary color used. That didn't really make much sense, because it caused the neutral colors to always have a purplish tint. It seems like maybe a bug that was fixed, because now it generates different neutral colors depending on the primary. I've updated our pre-defined palettes to capture these different neutrals. I created a script to convert the MDC theme builder exports to our palette CSS format. I'm not including it as part of this commit, but just FYI that it'll be cheap to add to / update our predefined palettes in the future. If we want the script checked in I can clean it up and make a separate PR for it. (cherry picked from commit 1735032)
1 parent cfe596a commit c5e4766

File tree

5 files changed

+390
-196
lines changed

5 files changed

+390
-196
lines changed

src/material-experimental/theming/_definition.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $theme-version: 1;
3838
}
3939

4040
$type: map.get($config, theme-type) or light;
41-
$primary: map.get($config, primary) or m3-palettes.$indigo-palette;
41+
$primary: map.get($config, primary) or m3-palettes.$purple-palette;
4242
$secondary: map.get($config, secondary) or $primary;
4343
$tertiary: map.get($config, tertiary) or $secondary;
4444

@@ -47,15 +47,15 @@ $theme-version: 1;
4747
theme-version: $theme-version,
4848
theme-type: $type,
4949
palettes: (
50-
primary: map.remove($primary, neutral-variant),
51-
secondary: map.remove($secondary, neutral-variant),
52-
tertiary: map.remove($tertiary, neutral-variant),
53-
neutral: m3-palettes.$neutral-palette,
50+
primary: map.remove($primary, neutral, neutral-variant),
51+
secondary: map.remove($secondary, neutral, neutral-variant),
52+
tertiary: map.remove($tertiary, neutral, neutral-variant),
53+
neutral: map.get($primary, neutral),
5454
neutral-variant: map.get($primary, neutral-variant),
55-
error: m3-palettes.$red-palette
55+
error: map.remove(m3-palettes.$red-palette, neutral, neutral-variant),
5656
),
57-
color-tokens: m3-tokens.generate-color-tokens($type, $primary, $secondary, $tertiary,
58-
m3-palettes.$neutral-palette, m3-palettes.$red-palette)
57+
color-tokens: m3-tokens.generate-color-tokens(
58+
$type, $primary, $secondary, $tertiary, m3-palettes.$red-palette)
5959
)
6060
);
6161
}

0 commit comments

Comments
 (0)