File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
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.
You can’t perform that action at this time.
0 commit comments