Skip to content

Commit e10b77a

Browse files
committed
fix(material/core): custom system-level variable prefix not used in some mixins
Fixes that the `system-level-colors` and `system-level-typography` mixins weren't using the `system-variables-prefix` passed in by the user. Note: a bit of a gotcha here is that we need to store two separate prefixes, because in theory the user can pass different prefixes into `color` and `typography`. Fixes #29504.
1 parent fd47a0e commit e10b77a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/material/core/theming/_definition.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ $theme-version: 1;
5555
neutral-variant: map.get($primary, neutral-variant),
5656
error: map.get($primary, error),
5757
),
58+
color-system-variables-prefix: $system-variables-prefix,
5859
color-tokens: m3-tokens.generate-color-tokens(
5960
$type, $primary, $tertiary, map.get($primary, error), $system-variables-prefix)
6061
)
@@ -88,6 +89,7 @@ $theme-version: 1;
8889
medium: $medium,
8990
regular: $regular,
9091
),
92+
typography-system-variables-prefix: $system-variables-prefix,
9193
typography-tokens: m3-tokens.generate-typography-tokens(
9294
$brand, $plain, $bold, $medium, $regular, $system-variables-prefix)
9395
)

src/material/core/tokens/_m3-tokens.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ $_cached-token-slots: null;
135135
);
136136

137137
$type: map.get($theme, _mat-theming-internals-do-not-access, theme-type);
138-
$system-variables-prefix: map.get($theme, system-variables-prefix) or sys;
138+
$system-variables-prefix: map.get($theme, _mat-theming-internals-do-not-access,
139+
color-system-variables-prefix) or sys;
139140
$primary: map.merge(map.get($palettes, primary), $base-palettes);
140141
$tertiary: map.merge(map.get($palettes, tertiary), $base-palettes);
141142
$error: map.get($palettes, error);
@@ -160,7 +161,8 @@ $_cached-token-slots: null;
160161
$bold: map.get($font-definition, bold);
161162
$medium: map.get($font-definition, medium);
162163
$regular: map.get($font-definition, regular);
163-
$system-variables-prefix: map.get($theme, system-variables-prefix) or sys;
164+
$system-variables-prefix: map.get($theme, _mat-theming-internals-do-not-access,
165+
typography-system-variables-prefix) or sys;
164166
$ref: (
165167
md-ref-typeface: _generate-ref-typeface-tokens($brand, $plain, $bold, $medium, $regular)
166168
);

0 commit comments

Comments
 (0)