File tree Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Expand file tree Collapse file tree 3 files changed +26
-6
lines changed Original file line number Diff line number Diff line change 207
207
@mixin density ($theme ) {
208
208
$density-scale : theming .clamp-density (inspection .get-theme-density ($theme ), -3 );
209
209
210
+ .mat-mdc-unelevated-button {
211
+ $density-tokens : tokens-mdc-button-filled .get-density-tokens ($theme );
212
+ @include mdc-button-filled-theme .theme ($density-tokens );
213
+ }
214
+
210
215
.mat-mdc-button ,
211
216
.mat-mdc-raised-button ,
212
- .mat-mdc-unelevated-button ,
213
217
.mat-mdc-outlined-button {
214
218
// Use `mat-mdc-button-base` to increase the specificity over the button's structural styles.
215
219
& .mat-mdc-button-base {
Original file line number Diff line number Diff line change
1
+ @use ' sass:map' ;
1
2
@use ' ../../token-utils' ;
2
3
@use ' ../../../mdc-helpers/mdc-helpers' ;
3
4
@use ' ../../../style/sass-utils' ;
4
5
@use ' ../../../theming/inspection' ;
6
+ @use ' ../../../theming/theming' ;
5
7
6
8
// The prefix used to generate the fully qualified name for tokens in this file.
7
9
$prefix : (mdc, button- filled);
@@ -15,8 +17,6 @@ $prefix: (mdc, button-filled);
15
17
@function get-unthemable-tokens () {
16
18
@return (
17
19
container- elevation: 0 ,
18
- container- height: 36px ,
19
- container- shape: 4px ,
20
20
disabled- container- elevation: 0 ,
21
21
focus- container- elevation: 0 ,
22
22
hover- container- elevation: 0 ,
@@ -77,7 +77,21 @@ $prefix: (mdc, button-filled);
77
77
78
78
// Tokens that can be configured through Angular Material's density theming API.
79
79
@function get-density-tokens ($theme ) {
80
- @return ();
80
+ $scale : theming .clamp-density (inspection .get-theme-density ($theme ), -3 );
81
+
82
+ @return (
83
+ container- height:
84
+ map .get (
85
+ (
86
+ 0 : 36px ,
87
+ -1 : 32px ,
88
+ -2 : 28px ,
89
+ -3 : 24px ,
90
+ ),
91
+ $scale
92
+ ),
93
+ container- shape: 4px
94
+ );
81
95
}
82
96
83
97
// Combines the tokens generated by the above functions into a single map with placeholder values.
Original file line number Diff line number Diff line change 1
1
@use ' sass:list' ;
2
2
@use ' sass:map' ;
3
3
4
+ @use ' @material/button/button-filled-theme' as mdc-button-filled-theme ;
4
5
@use ' @material/card/elevated-card-theme' as mdc-elevated-card-theme ;
5
6
@use ' @material/card/outlined-card-theme' as mdc-outlined-card-theme ;
6
7
@use ' @material/checkbox/checkbox-theme' as mdc-checkbox-theme ;
23
24
@use ' @material/textfield/outlined-text-field-theme' as mdc-outlined-text-field-theme ;
24
25
@use ' @material/theme/validate' as mdc-validate ;
25
26
27
+ @use ' ../m2/mdc/button-filled' as tokens-mdc-button-filled ;
26
28
@use ' ../m2/mdc/circular-progress' as tokens-mdc-circular-progress ;
27
29
@use ' ../m2/mdc/linear-progress' as tokens-mdc-linear-progress ;
28
30
@use ' ../m2/mdc/elevated-card' as tokens-mdc-elevated-card ;
158
160
);
159
161
@include validate-slots (
160
162
$component : ' m2.mdc.button-filled' ,
161
- $slots : tokens-mdc-extended-fab .get-token-slots (),
162
- $reference : mdc-extended-fab -theme .$extended- light-theme
163
+ $slots : tokens-mdc-button-filled .get-token-slots (),
164
+ $reference : mdc-button-filled -theme .$light-theme
163
165
);
You can’t perform that action at this time.
0 commit comments