Skip to content

Commit 079a3a7

Browse files
mmalerbazarend
authored andcommitted
fix(material/menu): move unthemable tokens to theme mixin (#27888)
Though these tokens are not currently affected by the theme, in the future they will be affected by the design system used for theming (M2 or M3) BREAKING CHANGE: There are new styles emitted by mat.menu-theme that are not emitted by any of: mat.menu-color, mat.menu-typography, mat.menu-density. If you rely on the partial mixins only and don't call mat.menu-theme, you can add mat.menu-base to get the missing styles.
1 parent 4c87bab commit 079a3a7

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/material/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
input-density, input-base;
104104
@forward './list/list-theme' as list-* show list-theme, list-color, list-typography,
105105
list-density, list-base;
106-
@forward './menu/menu-theme' as menu-* show menu-theme, menu-color, menu-typography, menu-density;
106+
@forward './menu/menu-theme' as menu-* show menu-theme, menu-color, menu-typography, menu-density, menu-base;
107107
@forward './paginator/paginator-theme' as paginator-* show paginator-theme, paginator-color,
108108
paginator-typography, paginator-density, paginator-base;
109109
@forward './progress-bar/progress-bar-theme' as progress-bar-* show

src/material/menu/_menu-theme.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
@use '../core/theming/inspection';
66
@use '../core/typography/typography';
77

8+
@mixin base($theme) {
9+
@include sass-utils.current-selector-or-root() {
10+
@include token-utils.create-token-values(tokens-mat-menu.$prefix,
11+
tokens-mat-menu.get-unthemable-tokens());
12+
}
13+
}
14+
815
@mixin color($theme) {
916
@include sass-utils.current-selector-or-root() {
1017
@include token-utils.create-token-values(tokens-mat-menu.$prefix,
@@ -23,6 +30,7 @@
2330

2431
@mixin theme($theme) {
2532
@include theming.private-check-duplicate-theme-styles($theme, 'mat-menu') {
33+
@include base($theme);
2634
@if inspection.theme-has($theme, color) {
2735
@include color($theme);
2836
}

src/material/menu/menu.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ mat-menu {
3333
}
3434

3535
.mat-mdc-menu-panel {
36-
@include token-utils.create-token-values(tokens-mat-menu.$prefix,
37-
tokens-mat-menu.get-unthemable-tokens());
3836
@include menu-common.base;
3937
box-sizing: border-box;
4038
outline: 0;

0 commit comments

Comments
 (0)