@angular/material 17.0.0-next.6 → 17.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/_index.scss +38 -31
  2. package/autocomplete/_autocomplete-theme.scss +3 -0
  3. package/badge/_badge-theme.scss +3 -0
  4. package/bottom-sheet/_bottom-sheet-theme.scss +8 -0
  5. package/button/_button-theme.scss +68 -51
  6. package/button/_fab-theme.scss +15 -11
  7. package/button/_icon-button-theme.scss +5 -0
  8. package/button-toggle/_button-toggle-theme.scss +14 -0
  9. package/chips/_chips-theme.scss +7 -0
  10. package/core/_core-theme.scss +9 -0
  11. package/core/option/_optgroup-theme.scss +3 -0
  12. package/core/option/_option-theme.scss +3 -0
  13. package/core/ripple/_ripple-theme.scss +5 -0
  14. package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +5 -0
  15. package/core/style/_sass-utils.scss +6 -1
  16. package/core/theming/_all-theme.scss +40 -0
  17. package/core/tokens/m2/mdc/{_button-filled.scss → _filled-button.scss} +20 -4
  18. package/core/tokens/m2/mdc/{_button-protected.scss → _protected-button.scss} +17 -4
  19. package/core/tokens/m2/mdc/_text-button.scss +103 -0
  20. package/datepicker/_datepicker-theme.scss +3 -0
  21. package/dialog/_dialog-theme.scss +2 -2
  22. package/divider/_divider-theme.scss +5 -0
  23. package/esm2022/bottom-sheet/bottom-sheet-container.mjs +3 -3
  24. package/esm2022/button/button.mjs +4 -4
  25. package/esm2022/button-toggle/button-toggle.mjs +2 -2
  26. package/esm2022/chips/chip-option.mjs +2 -2
  27. package/esm2022/chips/chip-row.mjs +2 -2
  28. package/esm2022/chips/chip.mjs +2 -2
  29. package/esm2022/core/version.mjs +1 -1
  30. package/esm2022/expansion/expansion-panel.mjs +3 -3
  31. package/esm2022/menu/menu.mjs +3 -3
  32. package/esm2022/sidenav/drawer.mjs +3 -3
  33. package/esm2022/sidenav/sidenav.mjs +3 -3
  34. package/esm2022/slide-toggle/slide-toggle.mjs +2 -2
  35. package/esm2022/snack-bar/module.mjs +20 -24
  36. package/esm2022/snack-bar/simple-snack-bar.mjs +8 -6
  37. package/esm2022/snack-bar/snack-bar-container.mjs +4 -4
  38. package/esm2022/snack-bar/snack-bar-content.mjs +7 -4
  39. package/esm2022/snack-bar/snack-bar.mjs +3 -4
  40. package/esm2022/table/table.mjs +2 -2
  41. package/esm2022/tabs/tab-header.mjs +2 -2
  42. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +2 -2
  43. package/esm2022/toolbar/toolbar.mjs +2 -2
  44. package/expansion/_expansion-theme.scss +8 -0
  45. package/fesm2022/bottom-sheet.mjs +2 -2
  46. package/fesm2022/bottom-sheet.mjs.map +1 -1
  47. package/fesm2022/button-toggle.mjs +2 -2
  48. package/fesm2022/button-toggle.mjs.map +1 -1
  49. package/fesm2022/button.mjs +4 -4
  50. package/fesm2022/button.mjs.map +1 -1
  51. package/fesm2022/chips.mjs +6 -6
  52. package/fesm2022/chips.mjs.map +1 -1
  53. package/fesm2022/core.mjs +1 -1
  54. package/fesm2022/core.mjs.map +1 -1
  55. package/fesm2022/expansion.mjs +2 -2
  56. package/fesm2022/expansion.mjs.map +1 -1
  57. package/fesm2022/menu.mjs +2 -2
  58. package/fesm2022/menu.mjs.map +1 -1
  59. package/fesm2022/sidenav.mjs +4 -4
  60. package/fesm2022/sidenav.mjs.map +1 -1
  61. package/fesm2022/slide-toggle.mjs +2 -2
  62. package/fesm2022/slide-toggle.mjs.map +1 -1
  63. package/fesm2022/snack-bar.mjs +48 -49
  64. package/fesm2022/snack-bar.mjs.map +1 -1
  65. package/fesm2022/table.mjs +2 -2
  66. package/fesm2022/table.mjs.map +1 -1
  67. package/fesm2022/tabs.mjs +4 -4
  68. package/fesm2022/tabs.mjs.map +1 -1
  69. package/fesm2022/toolbar.mjs +2 -2
  70. package/fesm2022/toolbar.mjs.map +1 -1
  71. package/form-field/_form-field-theme.scss +5 -0
  72. package/grid-list/_grid-list-theme.scss +2 -0
  73. package/icon/_icon-theme.scss +3 -0
  74. package/input/_input-theme.scss +3 -0
  75. package/menu/_menu-theme.scss +8 -0
  76. package/package.json +2 -2
  77. package/paginator/_paginator-theme.scss +3 -0
  78. package/prebuilt-themes/deeppurple-amber.css +1 -1
  79. package/prebuilt-themes/indigo-pink.css +1 -1
  80. package/prebuilt-themes/pink-bluegrey.css +1 -1
  81. package/prebuilt-themes/purple-green.css +1 -1
  82. package/progress-bar/_progress-bar-theme.scss +40 -19
  83. package/schematics/ng-add/index.js +1 -1
  84. package/schematics/ng-add/index.mjs +1 -1
  85. package/schematics/ng-generate/mdc-migration/index_bundled.js +2 -2
  86. package/schematics/ng-generate/mdc-migration/index_bundled.js.map +2 -2
  87. package/select/_select-theme.scss +3 -0
  88. package/sidenav/_sidenav-theme.scss +8 -0
  89. package/slide-toggle/_slide-toggle-theme.scss +7 -0
  90. package/slider/_slider-theme.scss +16 -16
  91. package/snack-bar/index.d.ts +13 -14
  92. package/sort/_sort-theme.scss +5 -0
  93. package/stepper/_stepper-theme.scss +3 -0
  94. package/table/_table-theme.scss +9 -11
  95. package/tabs/_tabs-common.scss +0 -10
  96. package/tabs/_tabs-theme.scss +15 -0
  97. package/toolbar/_toolbar-theme.scss +3 -0
  98. package/tree/_tree-theme.scss +5 -0
package/_index.scss CHANGED
@@ -52,59 +52,62 @@
52
52
  @forward './core/typography/all-typography' show all-component-typographies;
53
53
 
54
54
  // Component themes
55
- @forward './core/core-theme' as core-* show core-color, core-theme, core-typography, core-density;
56
- @forward './core/ripple/ripple-theme' as ripple-* show ripple-color, ripple-theme;
55
+ @forward './core/core-theme' as core-* show core-color, core-theme, core-typography, core-density,
56
+ core-base;
57
+ @forward './core/ripple/ripple-theme' as ripple-* show ripple-color, ripple-theme, ripple-base;
57
58
  @forward './core/option/option-theme' as option-* show option-color, option-typography,
58
- option-theme, option-density;
59
+ option-theme, option-density, option-base;
59
60
  @forward './core/option/optgroup-theme' as optgroup-* show optgroup-color, optgroup-typography,
60
- optgroup-theme, optgroup-density;
61
+ optgroup-theme, optgroup-density, optgroup-base;
61
62
  @forward './core/selection/pseudo-checkbox/pseudo-checkbox-theme' as pseudo-checkbox-* show
62
- pseudo-checkbox-color, pseudo-checkbox-typography, pseudo-checkbox-theme;
63
+ pseudo-checkbox-color, pseudo-checkbox-typography, pseudo-checkbox-theme, pseudo-checkbox-base;
63
64
  @forward './core/selection/pseudo-checkbox/pseudo-checkbox-common' as pseudo-checkbox-* show
64
65
  pseudo-checkbox-legacy-size;
65
66
  @forward './core/focus-indicators/focus-indicators-theme' as strong-focus-indicators-* show
66
67
  strong-focus-indicators-color, strong-focus-indicators-theme;
67
68
  @forward './autocomplete/autocomplete-theme' as autocomplete-* show autocomplete-theme,
68
- autocomplete-color, autocomplete-typography, autocomplete-density;
69
+ autocomplete-color, autocomplete-typography, autocomplete-density, autocomplete-base;
69
70
  @forward './badge/badge-theme' as badge-* show badge-theme, badge-color, badge-typography,
70
- badge-density;
71
+ badge-density, badge-base;
71
72
  @forward './bottom-sheet/bottom-sheet-theme' as bottom-sheet-* show bottom-sheet-theme,
72
- bottom-sheet-color, bottom-sheet-typography, bottom-sheet-density;
73
+ bottom-sheet-color, bottom-sheet-typography, bottom-sheet-density, bottom-sheet-base;
73
74
  @forward './button/button-theme' as button-* show button-theme, button-color, button-typography,
74
- button-density;
75
+ button-density, button-base;
75
76
  @forward './button/fab-theme' as fab-* show fab-color, fab-typography,
76
77
  fab-density, fab-theme, fab-base;
77
78
  @forward './button/icon-button-theme' as icon-button-* show icon-button-color,
78
- icon-button-typography, icon-button-density, icon-button-theme;
79
+ icon-button-typography, icon-button-density, icon-button-theme, icon-button-base;
79
80
  @forward './button-toggle/button-toggle-theme' as button-toggle-* show button-toggle-theme,
80
- button-toggle-color, button-toggle-typography, button-toggle-density;
81
+ button-toggle-color, button-toggle-typography, button-toggle-density, button-toggle-base;
81
82
  @forward './card/card-theme' as card-* show card-theme, card-color, card-typography, card-density,
82
83
  card-base;
83
84
  @forward './checkbox/checkbox-theme' as checkbox-* show checkbox-theme, checkbox-color,
84
85
  checkbox-typography, checkbox-density, checkbox-base;
85
86
  @forward './chips/chips-theme' as chips-* show chips-theme, chips-color, chips-typography,
86
- chips-density;
87
+ chips-density, chips-base;
87
88
  @forward './datepicker/datepicker-theme' as datepicker-* show datepicker-theme, datepicker-color,
88
- datepicker-typography, datepicker-date-range-colors, datepicker-density;
89
+ datepicker-typography, datepicker-date-range-colors, datepicker-density, datepicker-base;
89
90
  @forward './dialog/dialog-theme' as dialog-* show dialog-theme, dialog-color, dialog-typography,
90
91
  dialog-density, dialog-base;
91
92
  @forward './dialog/dialog-legacy-padding' as dialog-* show dialog-legacy-padding;
92
93
  @forward './divider/divider-theme' as divider-* show divider-theme, divider-color,
93
- divider-typography, divider-density;
94
+ divider-typography, divider-density, divider-base;
94
95
  @forward './expansion/expansion-theme' as expansion-* show expansion-theme, expansion-color,
95
- expansion-typography, expansion-density;
96
+ expansion-typography, expansion-density, expansion-base;
96
97
  @forward './form-field/form-field-theme' as form-field-* show form-field-theme,
97
- form-field-color, form-field-typography, form-field-density;
98
+ form-field-color, form-field-typography, form-field-density, form-field-base;
98
99
  @forward './grid-list/grid-list-theme' as grid-list-* show grid-list-theme, grid-list-color,
99
- grid-list-typography, grid-list-density;
100
- @forward './icon/icon-theme' as icon-* show icon-theme, icon-color, icon-typography, icon-density;
100
+ grid-list-typography, grid-list-density, grid-list-base;
101
+ @forward './icon/icon-theme' as icon-* show icon-theme, icon-color, icon-typography, icon-density,
102
+ icon-base;
101
103
  @forward './input/input-theme' as input-* show input-theme, input-color, input-typography,
102
- input-density;
104
+ input-density, input-base;
103
105
  @forward './list/list-theme' as list-* show list-theme, list-color, list-typography,
104
- list-density, list-base;
105
- @forward './menu/menu-theme' as menu-* show menu-theme, menu-color, menu-typography, menu-density;
106
+ list-density, list-base;
107
+ @forward './menu/menu-theme' as menu-* show menu-theme, menu-color, menu-typography, menu-density,
108
+ menu-base;
106
109
  @forward './paginator/paginator-theme' as paginator-* show paginator-theme, paginator-color,
107
- paginator-typography, paginator-density;
110
+ paginator-typography, paginator-density, paginator-base;
108
111
  @forward './progress-bar/progress-bar-theme' as progress-bar-* show
109
112
  progress-bar-theme, progress-bar-color, progress-bar-typography,
110
113
  progress-bar-density, progress-bar-base;
@@ -114,26 +117,30 @@ list-density, list-base;
114
117
  @forward './radio/radio-theme' as radio-* show radio-theme, radio-color, radio-typography,
115
118
  radio-density, radio-base;
116
119
  @forward './select/select-theme' as select-* show select-theme, select-color, select-typography,
117
- select-density;
120
+ select-density, select-base;
118
121
  @forward './sidenav/sidenav-theme' as sidenav-* show sidenav-theme, sidenav-color,
119
- sidenav-typography, sidenav-density;
122
+ sidenav-typography, sidenav-density, sidenav-base;
120
123
  @forward './slide-toggle/slide-toggle-theme' as slide-toggle-* show
121
- slide-toggle-theme, slide-toggle-color, slide-toggle-typography, slide-toggle-density;
124
+ slide-toggle-theme, slide-toggle-color, slide-toggle-typography, slide-toggle-density,
125
+ slide-toggle-base;
122
126
  @forward './slider/slider-theme' as slider-* show slider-theme, slider-color, slider-typography,
123
127
  slider-density, slider-base;
124
128
  @forward './snack-bar/snack-bar-theme' as snack-bar-* show snack-bar-theme, snack-bar-color,
125
129
  snack-bar-typography, snack-bar-density, snack-bar-base;
126
- @forward './sort/sort-theme' as sort-* show sort-theme, sort-color, sort-typography, sort-density;
130
+ @forward './sort/sort-theme' as sort-* show sort-theme, sort-color, sort-typography, sort-density,
131
+ sort-base;
127
132
  @forward './stepper/stepper-theme' as stepper-* show stepper-theme, stepper-color,
128
- stepper-typography, stepper-density;
133
+ stepper-typography, stepper-density, stepper-base;
129
134
  @forward './table/table-theme' as table-* show table-theme, table-color, table-typography,
130
- table-density;
131
- @forward './tabs/tabs-theme' as tabs-* show tabs-theme, tabs-color, tabs-typography, tabs-density;
135
+ table-density, table-base;
136
+ @forward './tabs/tabs-theme' as tabs-* show tabs-theme, tabs-color, tabs-typography, tabs-density,
137
+ tabs-base;
132
138
  @forward './toolbar/toolbar-theme' as toolbar-* show toolbar-theme, toolbar-color,
133
- toolbar-typography, toolbar-density;
139
+ toolbar-typography, toolbar-density, toolbar-base;
134
140
  @forward './tooltip/tooltip-theme' as tooltip-* show tooltip-theme, tooltip-color,
135
141
  tooltip-typography, tooltip-density, tooltip-base;
136
- @forward './tree/tree-theme' as tree-* show tree-theme, tree-color, tree-typography, tree-density;
142
+ @forward './tree/tree-theme' as tree-* show tree-theme, tree-color, tree-typography, tree-density,
143
+ tree-base;
137
144
 
138
145
  // MDC Helpers
139
146
  @forward './core/mdc-helpers/mdc-helpers' as private-* show private-using-mdc-theme,
@@ -5,6 +5,8 @@
5
5
  @use '../core/tokens/token-utils';
6
6
  @use '../core/tokens/m2/mat/autocomplete' as tokens-mat-autocomplete;
7
7
 
8
+ @mixin base($theme) {}
9
+
8
10
  @mixin color($theme) {
9
11
  @include sass-utils.current-selector-or-root() {
10
12
  @include token-utils.create-token-values(tokens-mat-autocomplete.$prefix,
@@ -18,6 +20,7 @@
18
20
 
19
21
  @mixin theme($theme) {
20
22
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-autocomplete') {
23
+ @include base($theme);
21
24
  @if inspection.theme-has($theme, color) {
22
25
  @include color($theme);
23
26
  }
@@ -164,6 +164,8 @@ $_emit-fallback-vars: true;
164
164
  }
165
165
  }
166
166
 
167
+ @mixin base($theme) {}
168
+
167
169
  @mixin color($theme) {
168
170
  @include sass-utils.current-selector-or-root() {
169
171
  @include token-utils.create-token-values(tokens-mat-badge.$prefix,
@@ -204,6 +206,7 @@ $_emit-fallback-vars: true;
204
206
  }
205
207
  }
206
208
 
209
+ @include base($theme);
207
210
  @if inspection.theme-has($theme, color) {
208
211
  @include color($theme);
209
212
  }
@@ -5,6 +5,13 @@
5
5
  @use '../core/tokens/token-utils';
6
6
  @use '../core/tokens/m2/mat/bottom-sheet' as tokens-mat-bottom-sheet;
7
7
 
8
+ @mixin base($theme) {
9
+ @include sass-utils.current-selector-or-root() {
10
+ @include token-utils.create-token-values(
11
+ tokens-mat-bottom-sheet.$prefix, tokens-mat-bottom-sheet.get-unthemable-tokens());
12
+ }
13
+ }
14
+
8
15
  @mixin color($theme) {
9
16
  @include sass-utils.current-selector-or-root() {
10
17
  @include token-utils.create-token-values(tokens-mat-bottom-sheet.$prefix,
@@ -23,6 +30,7 @@
23
30
 
24
31
  @mixin theme($theme) {
25
32
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-bottom-sheet') {
33
+ @include base($theme);
26
34
  @if inspection.theme-has($theme, color) {
27
35
  @include color($theme);
28
36
  }
@@ -12,66 +12,33 @@
12
12
  @use '../core/theming/theming';
13
13
  @use '../core/theming/inspection';
14
14
  @use '../core/typography/typography';
15
- @use '../core/tokens/m2/mdc/button-filled' as tokens-mdc-button-filled;
16
- @use '../core/tokens/m2/mdc/button-protected' as tokens-mdc-button-protected;
15
+ @use '../core/tokens/m2/mdc/filled-button' as tokens-mdc-filled-button;
16
+ @use '../core/tokens/m2/mdc/protected-button' as tokens-mdc-protected-button;
17
+ @use '../core/tokens/m2/mdc/text-button' as tokens-mdc-text-button;
17
18
 
18
19
  @function _on-color($theme, $palette) {
19
20
  $is-dark: inspection.get-theme-type($theme) == dark;
20
21
  @return if(mdc-helpers.variable-safe-contrast-tone($palette, $is-dark) == 'dark', #000, #fff);
21
22
  }
22
23
 
23
- @mixin _button-variant($color) {
24
- @include mdc-button-text-theme.theme((
25
- label-text-color: $color,
26
- ));
27
- }
28
-
29
24
  @mixin _outlined-button-variant($color) {
30
25
  @include mdc-button-outlined-theme.theme((
31
26
  label-text-color: $color,
32
27
  ));
33
28
  }
34
29
 
30
+ @mixin base($theme) {
31
+ // TODO(mmalerba): Move button base tokens here
32
+ }
33
+
35
34
  @mixin color($theme) {
36
35
  @include mdc-helpers.using-mdc-theme($theme) {
37
36
  $is-dark: inspection.get-theme-type($theme) == dark;
38
37
  $on-surface: mdc-theme-color.prop-value(on-surface);
39
- $surface: mdc-theme-color.prop-value(surface);
40
38
  $disabled-ink-color: rgba($on-surface, if($is-dark, 0.5, 0.38));
41
- $disabled-container-color: rgba($on-surface, 0.12);
42
39
  $primary: mdc-theme-color.prop-value(primary);
43
- $on-primary: mdc-theme-color.prop-value(on-primary);
44
40
  $secondary: mdc-theme-color.prop-value(secondary);
45
- $on-secondary: mdc-theme-color.prop-value(on-secondary);
46
41
  $error: mdc-theme-color.prop-value(error);
47
- $on-error: mdc-theme-color.prop-value(on-error);
48
-
49
- .mat-mdc-button {
50
- &.mat-unthemed {
51
- @include _button-variant($on-surface);
52
- }
53
-
54
- &.mat-primary {
55
- @include _button-variant($primary);
56
- }
57
-
58
- &.mat-accent {
59
- @include _button-variant($secondary);
60
- }
61
-
62
- &.mat-warn {
63
- @include _button-variant($error);
64
- }
65
-
66
- @include button-theme-private.apply-disabled-style() {
67
- @include mdc-button-text-theme.theme((
68
- // We need to pass both the disabled and enabled values, because the enabled
69
- // ones apply to anchors while the disabled ones are for buttons.
70
- disabled-label-text-color: $disabled-ink-color,
71
- label-text-color: $disabled-ink-color
72
- ));
73
- }
74
- }
75
42
 
76
43
  .mat-mdc-outlined-button {
77
44
  @include mdc-button-outlined-theme.theme((
@@ -126,11 +93,30 @@
126
93
  $on-accent: _on-color($theme, $accent);
127
94
  $on-error: _on-color($theme, $error);
128
95
 
96
+ .mat-mdc-button {
97
+ @include mdc-button-text-theme.theme(tokens-mdc-text-button.get-color-tokens($theme));
98
+
99
+ &.mat-primary {
100
+ @include mdc-button-text-theme.theme(
101
+ tokens-mdc-text-button.private-get-color-palette-color-tokens($theme, primary));
102
+ }
103
+
104
+ &.mat-accent {
105
+ @include mdc-button-text-theme.theme(
106
+ tokens-mdc-text-button.private-get-color-palette-color-tokens($theme, accent));
107
+ }
108
+
109
+ &.mat-warn {
110
+ @include mdc-button-text-theme.theme(
111
+ tokens-mdc-text-button.private-get-color-palette-color-tokens($theme, warn));
112
+ }
113
+ }
114
+
129
115
  .mat-mdc-unelevated-button {
130
- $default-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $surface, $on-surface);
131
- $primary-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $primary, $on-primary);
132
- $accent-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $accent, $on-accent);
133
- $warn-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $error, $on-error);
116
+ $default-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $surface, $on-surface);
117
+ $primary-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $primary, $on-primary);
118
+ $accent-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $accent, $on-accent);
119
+ $warn-color-tokens: tokens-mdc-filled-button.get-color-tokens($theme, $error, $on-error);
134
120
 
135
121
  &.mat-unthemed {
136
122
  @include mdc-button-filled-theme.theme($default-color-tokens);
@@ -150,14 +136,18 @@
150
136
  }
151
137
 
152
138
  .mat-mdc-raised-button {
153
- $default-color-tokens: tokens-mdc-button-protected.get-color-tokens(
139
+ $default-color-tokens: tokens-mdc-protected-button.get-color-tokens(
154
140
  $theme,
155
141
  $surface,
156
142
  $on-surface
157
143
  );
158
- $primary-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $primary, $on-primary);
159
- $accent-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $accent, $on-accent);
160
- $warn-color-tokens: tokens-mdc-button-filled.get-color-tokens($theme, $error, $on-error);
144
+ $primary-color-tokens: tokens-mdc-protected-button.get-color-tokens(
145
+ $theme,
146
+ $primary,
147
+ $on-primary
148
+ );
149
+ $accent-color-tokens: tokens-mdc-protected-button.get-color-tokens($theme, $accent, $on-accent);
150
+ $warn-color-tokens: tokens-mdc-protected-button.get-color-tokens($theme, $error, $on-error);
161
151
 
162
152
  &.mat-unthemed {
163
153
  @include mdc-button-protected-theme.theme($default-color-tokens);
@@ -193,6 +183,17 @@
193
183
  $disabled-ink-color: rgba($on-surface, if($is-dark, 0.5, 0.38));
194
184
  $disabled-container-color: rgba($on-surface, 0.12);
195
185
 
186
+ // TODO: these disabled styles are a bit too specific currently.
187
+ // Once the buttons are fully tokenized, we should rework how they're applied.
188
+ .mat-mdc-button {
189
+ @include button-theme-private.apply-disabled-style() {
190
+ @include mdc-button-text-theme.theme((
191
+ disabled-label-text-color: $disabled-ink-color,
192
+ label-text-color: $disabled-ink-color,
193
+ ));
194
+ }
195
+ }
196
+
196
197
  .mat-mdc-raised-button {
197
198
  @include button-theme-private.apply-disabled-style() {
198
199
  @include mdc-elevation-theme.elevation(0);
@@ -226,9 +227,24 @@
226
227
  @mixin density($theme) {
227
228
  $density-scale: theming.clamp-density(inspection.get-theme-density($theme), -3);
228
229
 
229
- .mat-mdc-button,
230
- .mat-mdc-raised-button,
231
- .mat-mdc-unelevated-button,
230
+ .mat-mdc-button {
231
+ $density-tokens: tokens-mdc-text-button.get-density-tokens($theme);
232
+ @include mdc-button-text-theme.theme($density-tokens);
233
+ @include button-theme-private.touch-target-density($density-scale);
234
+ }
235
+
236
+ .mat-mdc-raised-button {
237
+ $density-tokens: tokens-mdc-protected-button.get-density-tokens($theme);
238
+ @include mdc-button-protected-theme.theme($density-tokens);
239
+ @include button-theme-private.touch-target-density($density-scale);
240
+ }
241
+
242
+ .mat-mdc-unelevated-button {
243
+ $density-tokens: tokens-mdc-filled-button.get-density-tokens($theme);
244
+ @include mdc-button-filled-theme.theme($density-tokens);
245
+ @include button-theme-private.touch-target-density($density-scale);
246
+ }
247
+
232
248
  .mat-mdc-outlined-button {
233
249
  // Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
234
250
  &.mat-mdc-button-base {
@@ -240,6 +256,7 @@
240
256
 
241
257
  @mixin theme($theme) {
242
258
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-button') {
259
+ @include base($theme);
243
260
  @if inspection.theme-has($theme, color) {
244
261
  @include color($theme);
245
262
  }
@@ -51,32 +51,36 @@
51
51
  $disabled: rgba($on-surface, 0.12);
52
52
  $on-disabled: rgba($on-surface, if($is-dark, 0.5, 0.38));
53
53
 
54
- .mat-mdc-fab,
55
- .mat-mdc-mini-fab {
54
+ @include sass-utils.current-selector-or-root() {
56
55
  // TODO(wagnermaciel): The ripple-theme-styles mixin depends heavily on
57
56
  // being wrapped by using-mdc-theme. This workaround needs to be
58
57
  // revisited w/ a more holistic solution.
59
- @include mdc-helpers.using-mdc-theme($theme) {
60
- @include button-theme-private.ripple-theme-styles($theme, true);
58
+ .mat-mdc-fab,
59
+ .mat-mdc-mini-fab {
60
+ @include mdc-helpers.using-mdc-theme($theme) {
61
+ @include button-theme-private.ripple-theme-styles($theme, true);
62
+ }
61
63
  }
62
64
 
63
- @include button-theme-private.apply-disabled-style() {
64
- @include _fab-variant($on-disabled, $disabled);
65
+ :disabled, a[disabled='true'] {
66
+ @include button-theme-private.apply-disabled-style() {
67
+ @include _fab-variant($on-disabled, $disabled);
68
+ }
65
69
  }
66
70
 
67
- &.mat-unthemed {
71
+ .mat-unthemed {
68
72
  @include _fab-variant($on-surface, $surface);
69
73
  }
70
74
 
71
- &.mat-primary {
75
+ .mat-primary {
72
76
  @include _fab-variant($on-primary, $primary);
73
77
  }
74
78
 
75
- &.mat-accent {
79
+ .mat-accent {
76
80
  @include _fab-variant($on-accent, $accent);
77
81
  }
78
82
 
79
- &.mat-warn {
83
+ .mat-warn {
80
84
  @include _fab-variant($on-warn, $warn);
81
85
  }
82
86
  }
@@ -88,7 +92,7 @@
88
92
  }
89
93
 
90
94
  $typography-tokens: tokens-mdc-extended-fab.get-typography-tokens($theme);
91
- .mat-mdc-extended-fab {
95
+ @include sass-utils.current-selector-or-root() {
92
96
  @include mdc-extended-fab-theme.theme($typography-tokens);
93
97
  }
94
98
  }
@@ -23,6 +23,10 @@ $_icon-size: 24px;
23
23
  @return if($is-dark, 'light', 'dark');
24
24
  }
25
25
 
26
+ @mixin base($theme) {
27
+ // TODO(mmalerba): Move icon button base tokens here
28
+ }
29
+
26
30
  @mixin color($theme) {
27
31
  $color-tokens: tokens-mdc-icon-button.get-color-tokens($theme);
28
32
  $surface: inspection.get-theme-color($theme, background, card);
@@ -104,6 +108,7 @@ $_icon-size: 24px;
104
108
 
105
109
  @mixin theme($theme) {
106
110
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-icon-button') {
111
+ @include base($theme);
107
112
  @if inspection.theme-has($theme, color) {
108
113
  @include color($theme);
109
114
  }
@@ -6,6 +6,19 @@
6
6
  @use '../core/tokens/token-utils';
7
7
  @use '../core/style/sass-utils';
8
8
 
9
+ @mixin base($theme) {
10
+ @include sass-utils.current-selector-or-root() {
11
+ @include token-utils.create-token-values(
12
+ tokens-mat-legacy-button-toggle.$prefix,
13
+ tokens-mat-legacy-button-toggle.get-unthemable-tokens()
14
+ );
15
+ @include token-utils.create-token-values(
16
+ tokens-mat-standard-button-toggle.$prefix,
17
+ tokens-mat-standard-button-toggle.get-unthemable-tokens()
18
+ );
19
+ }
20
+ }
21
+
9
22
  @mixin color($theme) {
10
23
  @include sass-utils.current-selector-or-root() {
11
24
  @include token-utils.create-token-values(tokens-mat-legacy-button-toggle.$prefix,
@@ -35,6 +48,7 @@
35
48
 
36
49
  @mixin theme($theme) {
37
50
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-button-toggle') {
51
+ @include base($theme);
38
52
  @if inspection.theme-has($theme, color) {
39
53
  @include color($theme);
40
54
  }
@@ -5,6 +5,12 @@
5
5
  @use '../core/theming/inspection';
6
6
  @use '../core/typography/typography';
7
7
 
8
+ @mixin base($theme) {
9
+ .mat-mdc-standard-chip {
10
+ @include mdc-chip-theme.theme(tokens-mdc-chip.get-unthemable-tokens());
11
+ }
12
+ }
13
+
8
14
  @mixin color($theme) {
9
15
  .mat-mdc-standard-chip {
10
16
  $default-color-tokens: tokens-mdc-chip.get-color-tokens($theme);
@@ -48,6 +54,7 @@
48
54
 
49
55
  @mixin theme($theme) {
50
56
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-chips') {
57
+ @include base($theme);
51
58
  @if inspection.theme-has($theme, color) {
52
59
  @include color($theme);
53
60
  }
@@ -8,6 +8,14 @@
8
8
  @use './style/elevation';
9
9
  @use './typography/typography';
10
10
 
11
+ @mixin base($theme) {
12
+ @include ripple-theme.base($theme);
13
+ @include option-theme.base($theme);
14
+ @include optgroup-theme.base($theme);
15
+ @include pseudo-checkbox-theme.base($theme);
16
+ // TODO(mmalerba): Move additional core base tokens here
17
+ }
18
+
11
19
  @mixin color($theme) {
12
20
  @include ripple-theme.color($theme);
13
21
  @include option-theme.color($theme);
@@ -64,6 +72,7 @@
64
72
  // there won't be multiple warnings. e.g. if `mat-core-theme` reports a warning, then
65
73
  // the imported themes (such as `mat-ripple-theme`) should not report again.
66
74
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') {
75
+ @include base($theme);
67
76
  @if inspection.theme-has($theme, color) {
68
77
  @include color($theme);
69
78
  }
@@ -6,6 +6,8 @@
6
6
  @use '../theming/inspection';
7
7
  @use '../typography/typography';
8
8
 
9
+ @mixin base($theme) {}
10
+
9
11
  @mixin color($theme) {
10
12
  @include sass-utils.current-selector-or-root() {
11
13
  @include token-utils.create-token-values(tokens-mat-optgroup.$prefix,
@@ -25,6 +27,7 @@
25
27
 
26
28
  @mixin theme($theme) {
27
29
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-optgroup') {
30
+ @include base($theme);
28
31
  @if inspection.theme-has($theme, color) {
29
32
  @include color($theme);
30
33
  }
@@ -6,6 +6,8 @@
6
6
  @use '../theming/inspection';
7
7
  @use '../typography/typography';
8
8
 
9
+ @mixin base($theme) {}
10
+
9
11
  @mixin color($theme) {
10
12
  @include sass-utils.current-selector-or-root() {
11
13
  @include token-utils.create-token-values(tokens-mat-option.$prefix,
@@ -35,6 +37,7 @@
35
37
 
36
38
  @mixin theme($theme) {
37
39
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-option') {
40
+ @include base($theme);
38
41
  @if inspection.theme-has($theme, color) {
39
42
  @include color($theme);
40
43
  }
@@ -2,6 +2,10 @@
2
2
  @use '../theming/theming';
3
3
  @use '../theming/inspection';
4
4
 
5
+ @mixin base($theme) {
6
+ // TODO(mmalerba): Move ripple base tokens here
7
+ }
8
+
5
9
  // Colors for the ripple elements.
6
10
  @mixin color($theme) {
7
11
  $foreground-base: inspection.get-theme-color($theme, foreground, base);
@@ -22,6 +26,7 @@
22
26
 
23
27
  @mixin theme($theme) {
24
28
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-ripple') {
29
+ @include base($theme);
25
30
  @if inspection.theme-has($theme, color) {
26
31
  @include color($theme);
27
32
  }
@@ -19,6 +19,10 @@
19
19
  }
20
20
  }
21
21
 
22
+ @mixin base($theme) {
23
+ // TODO(mmalerba): Move pseudo checkbox base tokens here
24
+ }
25
+
22
26
  @mixin color($theme) {
23
27
  $is-dark-theme: inspection.get-theme-type($theme) == dark;
24
28
  $primary: inspection.get-theme-color($theme, primary);
@@ -78,6 +82,7 @@
78
82
 
79
83
  @mixin theme($theme) {
80
84
  @include theming.private-check-duplicate-theme-styles($theme, 'mat-pseudo-checkbox') {
85
+ @include base($theme);
81
86
  @if inspection.theme-has($theme, color) {
82
87
  @include color($theme);
83
88
  }
@@ -10,9 +10,14 @@
10
10
  /// @content Content to output under the current selector, or root selector if there is no current
11
11
  /// selector.
12
12
  @mixin current-selector-or-root($root: html) {
13
- @at-root #{& or $root} {
13
+ @if & {
14
14
  @content;
15
15
  }
16
+ @else {
17
+ #{$root} {
18
+ @content;
19
+ }
20
+ }
16
21
  }
17
22
 
18
23
  /// A version of the standard `map.merge` function that takes a variable number of arguments.
@@ -82,6 +82,46 @@
82
82
  }
83
83
  }
84
84
 
85
+ @mixin all-component-bases($theme) {
86
+ @include core-theme.base($theme);
87
+ @include card-theme.base($theme);
88
+ @include progress-bar-theme.base($theme);
89
+ @include tooltip-theme.base($theme);
90
+ @include form-field-theme.base($theme);
91
+ @include input-theme.base($theme);
92
+ @include select-theme.base($theme);
93
+ @include autocomplete-theme.base($theme);
94
+ @include dialog-theme.base($theme);
95
+ @include chips-theme.base($theme);
96
+ @include slide-toggle-theme.base($theme);
97
+ @include radio-theme.base($theme);
98
+ @include slider-theme.base($theme);
99
+ @include menu-theme.base($theme);
100
+ @include list-theme.base($theme);
101
+ @include paginator-theme.base($theme);
102
+ @include tabs-theme.base($theme);
103
+ @include checkbox-theme.base($theme);
104
+ @include button-theme.base($theme);
105
+ @include icon-button-theme.base($theme);
106
+ @include fab-theme.base($theme);
107
+ @include snack-bar-theme.base($theme);
108
+ @include table-theme.base($theme);
109
+ @include progress-spinner-theme.base($theme);
110
+ @include badge-theme.base($theme);
111
+ @include bottom-sheet-theme.base($theme);
112
+ @include button-toggle-theme.base($theme);
113
+ @include datepicker-theme.base($theme);
114
+ @include divider-theme.base($theme);
115
+ @include expansion-theme.base($theme);
116
+ @include grid-list-theme.base($theme);
117
+ @include icon-theme.base($theme);
118
+ @include sidenav-theme.base($theme);
119
+ @include stepper-theme.base($theme);
120
+ @include sort-theme.base($theme);
121
+ @include toolbar-theme.base($theme);
122
+ @include tree-theme.base($theme);
123
+ }
124
+
85
125
  // @deprecated Use `all-component-themes`.
86
126
  @mixin angular-material-theme($theme) {
87
127
  @include all-component-themes($theme);