Skip to content

Commit 6ec3f26

Browse files
committed
refactor(material/core): post migration fixup
1 parent 4b8564f commit 6ec3f26

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/material/core/theming/_theming.scss

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ $_mat-theme-emitted-density: () !default;
109109
@return (
110110
primary: $primary,
111111
accent: $accent,
112-
warn: if($warn != null, $warn, palette(palette.$red)),
112+
warn: if($warn != null, $warn, palette(palette.$mat-red)),
113113
is-dark: false,
114-
foreground: palette.$light-theme-foreground,
115-
background: palette.$light-theme-background,
114+
foreground: palette.$mat-light-theme-foreground,
115+
background: palette.$mat-light-theme-background,
116116
);
117117
}
118118

@@ -122,17 +122,17 @@ $_mat-theme-emitted-density: () !default;
122122
@return (
123123
primary: $primary,
124124
accent: $accent,
125-
warn: if($warn != null, $warn, palette(palette.$red)),
125+
warn: if($warn != null, $warn, palette(palette.$mat-red)),
126126
is-dark: true,
127-
foreground: palette.$dark-theme-foreground,
128-
background: palette.$dark-theme-background,
127+
foreground: palette.$mat-dark-theme-foreground,
128+
background: palette.$mat-dark-theme-background,
129129
);
130130
}
131131

132132
// Creates a container object for a light theme to be given to individual component theme mixins.
133133
// TODO: Remove legacy API and rename `$primary` to `$config`. Currently it cannot be renamed
134134
// as it would break existing apps that set the parameter by name.
135-
@function light-theme($primary, $accent: null, $warn: palette(palette.$red)) {
135+
@function light-theme($primary, $accent: null, $warn: palette(palette.$mat-red)) {
136136
// This function creates a container object for the individual component theme mixins. Consumers
137137
// can construct such an object by calling this function, or by building the object manually.
138138
// There are two possible ways to invoke this function in order to create such an object:
@@ -169,7 +169,7 @@ $_mat-theme-emitted-density: () !default;
169169
// Creates a container object for a dark theme to be given to individual component theme mixins.
170170
// TODO: Remove legacy API and rename `$primary` to `$config`. Currently it cannot be renamed
171171
// as it would break existing apps that set the parameter by name.
172-
@function dark-theme($primary, $accent: null, $warn: palette(palette.$red)) {
172+
@function dark-theme($primary, $accent: null, $warn: palette(palette.$mat-red)) {
173173
// This function creates a container object for the individual component theme mixins. Consumers
174174
// can construct such an object by calling this function, or by building the object manually.
175175
// There are two possible ways to invoke this function in order to create such an object:
@@ -339,15 +339,14 @@ $_mat-theme-emitted-density: () !default;
339339
// styles **once** and at root. This matches the old behavior where density styles were
340340
// part of the base component styles (that did not use view encapsulation).
341341
// TODO: Remove this compatibility logic when the legacy theming API is removed.
342-
$mat-private-density-generate-at-root: is-legacy-constructed-theme($theme);
343-
$mat-private-density-generate-styles: not $duplicate-legacy-density;
342+
compatibility.$density-generate-at-root: is-legacy-constructed-theme($theme);
343+
compatibility.$density-generate-styles: not $duplicate-legacy-density;
344344

345345
@content;
346346
$theme-ignore-duplication-warnings: $orig-mat-theme-ignore-duplication-warnings !global;
347347

348-
// TODO: after the migration is finished, these need to refer to the `compatibility` import.
349-
$mat-private-density-generate-at-root: false;
350-
$mat-private-density-generate-styles: true;
348+
compatibility.$density-generate-at-root: false;
349+
compatibility.$density-generate-styles: true;
351350
}
352351

353352
// Checks whether the given value resolves to a theme object. Theme objects are always

0 commit comments

Comments
 (0)