File tree Expand file tree Collapse file tree 12 files changed +62
-27
lines changed Expand file tree Collapse file tree 12 files changed +62
-27
lines changed Original file line number Diff line number Diff line change 5
5
@use ' @material/button/button-filled-theme' as mdc-button-filled-theme ;
6
6
@use ' @material/button/button-protected-theme' as mdc-button-protected-theme ;
7
7
@use ' @material/button/button-outlined-theme' as mdc-button-outlined-theme ;
8
- @use ' @material/typography/typography' as mdc-typography ;
9
8
@use ' @material/theme/custom-properties' as mdc-custom-properties ;
10
9
11
10
@use ' ./button-base' ;
155
154
// Similar to MDC's `_icon-structure`, apart from the margin which we
156
155
// handle via custom tokens in `mat-private-button-horizontal-layout`.
157
156
& > .mat-icon {
158
- $icon-size : mdc-typography . px-to-rem ( 18 px ) ;
157
+ $icon-size : 1.125 rem ;
159
158
display : inline-block ;
160
159
position : relative ;
161
160
vertical-align : top ;
Original file line number Diff line number Diff line change 1
1
@use ' @material/form-field/form-field' as mdc-form-field ;
2
- @use ' @material/typography/typography' as mdc-typography ;
3
2
@use ' @material/theme/custom-properties' as mdc-custom-properties ;
3
+ @use ' ../style/vendor-prefixes' ;
4
4
@use ' ../mdc-helpers/mdc-helpers' ;
5
5
6
6
@include mdc-custom-properties .configure ($emit-fallback-values : false, $emit-fallback-vars : false) {
7
7
@include mdc-form-field .static-styles ($query : mdc-helpers .$mdc-base-styles-query );
8
8
}
9
9
10
10
.mat-internal-form-field {
11
- @include mdc-typography .smooth-font ();
11
+ @include vendor-prefixes .smooth-font ();
12
12
}
Original file line number Diff line number Diff line change 1
1
@use ' sass:map' ;
2
2
@use ' sass:math' ;
3
3
@use ' sass:meta' ;
4
+ @use ' sass:string' ;
4
5
@use ' @material/typography' as mdc-typography ;
5
6
7
+ $_default-font-family : string .unquote (' Roboto, sans-serif' );
8
+
6
9
/// Defines a typography level from the Material Design spec.
7
10
/// @param {String} $font-size The font-size for this level.
8
11
/// @param {String | Number} $line-height The line-height for this level.
123
126
@function define-typography-config (
124
127
// TODO (mmalerba ): rename this function to define-typography-config ,
125
128
// and create a predefined px based config for people that need it.
126
- $font-family : mdc-typography . $ font-family ,
129
+ $font-family : $_default- font-family ,
127
130
$headline-1 : null ,
128
131
$headline-2 : null ,
129
132
$headline-3 : null ,
180
183
@function define-rem-typography-config (
181
184
// TODO (mmalerba ): rename this function to define-typography-config ,
182
185
// and create a predefined px based config for people that need it.
183
- $font-family : mdc-typography . $ font-family ,
186
+ $font-family : $_default- font-family ,
184
187
$headline-1 : null ,
185
188
$headline-2 : null ,
186
189
$headline-3 : null ,
Original file line number Diff line number Diff line change 1
1
// TODO(mmalerba): this file should be split into separate cohesive partials for things like
2
2
// "theming", "typography", "core".
3
+ @use ' sass:string' ;
3
4
@use ' ../typography/typography' ;
4
5
@use ' @material/feature-targeting' as mdc-feature-targeting ;
5
- @use ' @material/typography' as mdc-typography ;
6
6
@use ' @material/theme/theme-color' as mdc-theme-color ;
7
7
@use ' @material/theme/css' as mdc-theme-css ;
8
8
@@ -32,7 +32,7 @@ $mdc-typography-styles-query: typography;
32
32
@function private-fallback-typography-from-mdc () {
33
33
// This is very close to what we have in `define-typography-config`, but we can't use it here,
34
34
// because it would cause a circular import and moving it here doesn't make sense.
35
- $font-family : mdc-typography . $font-family ;
35
+ $font-family : string . unquote ( ' Roboto, sans-serif ' ) ;
36
36
@return (
37
37
font-family : $font-family ,
38
38
headline- 1: typography .typography-config-level-from-mdc (headline1 , $font-family ),
Original file line number Diff line number Diff line change 1
- @use ' @material/typography' as mdc-typography ;
2
- @use ' ../../m2/typography' as m2-typography ;
1
+ @use ' sass:string' ;
3
2
@use ' sass:map' ;
4
3
@use ' sass:meta' ;
4
+ @use ' ../../m2/typography' as m2-typography ;
5
+
6
+ $_font-family : string .unquote (' Roboto, sans-serif' );
5
7
6
8
@function assert-font-family ($test-name , $obj , $expected ) {
7
9
@each $level-name , $level in $obj {
16
18
$no-font-family : assert-font-family (
17
19
' should take default MDC font family if none is specified' ,
18
20
m2-typography .define-typography-config (),
19
- mdc-typography . $font -family );
21
+ $_font -family );
20
22
21
23
$only-top-level-font-family : assert-font-family (
22
24
' should take custom font family if specified at top level' ,
@@ -40,7 +42,7 @@ $individual-levels-without-font-families: assert-font-family(
40
42
$button : m2-typography .define-typography-level ($font-size : 1px ),
41
43
$overline : m2-typography .define-typography-level ($font-size : 1px ),
42
44
),
43
- mdc-typography . $font -family
45
+ $_font -family
44
46
);
45
47
46
48
$individual-levels-without-font-families-with-top-level-family : assert-font-family (
Original file line number Diff line number Diff line change 1
1
@use ' @angular/cdk' ;
2
- @use ' @material/typography/typography' as mdc-typography ;
3
2
@use ' ../core/tokens/m2/mdc/dialog' as tokens-mdc-dialog ;
4
3
@use ' ../core/tokens/m2/mat/dialog' as tokens-mat-dialog ;
5
4
@use ' ../core/mdc-helpers/mdc-helpers' ;
@@ -153,12 +152,23 @@ $_emit-fallbacks: true;
153
152
}
154
153
155
154
.mat-mdc-dialog-title {
156
- @include mdc-typography . text-baseline ( $top : 40 px , $ display : block , $lineHeight : null) ;
155
+ display : block ;
157
156
position : relative ;
158
157
flex-shrink : 0 ;
159
158
box-sizing : border-box ;
160
159
margin : 0 0 1px ;
161
160
161
+ // This was used by MDC to set the text baseline. We should figure out a way to
162
+ // remove it, because it can introduce unnecessary whitespace at the beginning
163
+ // of the element.
164
+ & ::before {
165
+ display : inline-block ;
166
+ width : 0 ;
167
+ height : 40px ;
168
+ content : ' ' ;
169
+ vertical-align : 0 ;
170
+ }
171
+
162
172
[dir = ' rtl' ] & {
163
173
text-align : right ;
164
174
}
Original file line number Diff line number Diff line change 1
- @use ' @material/typography' as mdc-typography ;
2
1
@use ' @material/textfield/variables' as mdc-textfield-variables ;
3
2
4
3
@use ' ../core/tokens/m2/mat/form-field' as tokens-mat-form-field ;
4
+ @use ' ../core/style/vendor-prefixes' ;
5
5
@use ' ../core/tokens/token-utils' ;
6
6
7
7
@mixin private-form-field-subscript () {
68
68
.mat-mdc-form-field-bottom-align ::before {
69
69
@include token-utils .use-tokens (tokens-mat-form-field .$prefix ,
70
70
tokens-mat-form-field .get-token-slots ()) {
71
- @include mdc-typography .smooth-font ();
71
+ @include vendor-prefixes .smooth-font ();
72
72
@include token-utils .create-token-slot (font-family , subscript- text- font);
73
73
@include token-utils .create-token-slot (line-height , subscript- text- line- height);
74
74
@include token-utils .create-token-slot (font-size , subscript- text- size);
Original file line number Diff line number Diff line change 1
1
@use ' @material/textfield/variables' as mdc-textfield-variables ;
2
- @use ' @material/typography/typography' as mdc-typography ;
3
2
@use ' ../core/tokens/m2/mat/form-field' as tokens-mat-form-field ;
4
3
@use ' ../core/tokens/token-utils' ;
5
4
@use ' ../core/style/vendor-prefixes' ;
@@ -25,7 +24,7 @@ $_enable-form-field-will-change-reset: true;
25
24
// Note: We increase specificity here because the MDC textfield seems to override this,
26
25
// depending on the CSS order, with an affix selector joint with the input.
27
26
.mat-mdc-form-field-input-control.mat-mdc-form-field-input-control {
28
- @include mdc-typography .smooth-font ();
27
+ @include vendor-prefixes .smooth-font ();
29
28
font : inherit ;
30
29
letter-spacing : inherit ;
31
30
text-decoration : inherit ;
@@ -34,7 +33,7 @@ $_enable-form-field-will-change-reset: true;
34
33
}
35
34
36
35
.mat-mdc-form-field .mat-mdc-floating-label.mdc-floating-label {
37
- @include mdc-typography .smooth-font ();
36
+ @include vendor-prefixes .smooth-font ();
38
37
39
38
// In order to ensure proper alignment of the floating label, we reset its line-height.
40
39
// The line-height is not important as the element is absolutely positioned and only has one
Original file line number Diff line number Diff line change 8
8
@use ' @material/line-ripple/line-ripple' as mdc-line-ripple ;
9
9
@use ' @material/line-ripple/line-ripple-theme' as mdc-line-ripple-theme ;
10
10
@use ' @material/theme/custom-properties' as mdc-custom-properties ;
11
- @use ' @material/typography' as mdc-typography ;
12
11
@use ' ../core/tokens/token-utils' ;
13
12
@use ' ../core/mdc-helpers/mdc-helpers' ;
14
13
@use ' ../core/style/vendor-prefixes' ;
@@ -91,7 +90,7 @@ $_icon-prefix-infix-padding: 4px;
91
90
92
91
@include token-utils .use-tokens (tokens-mat-form-field .$prefix ,
93
92
tokens-mat-form-field .get-token-slots ()) {
94
- @include mdc-typography .smooth-font ();
93
+ @include vendor-prefixes .smooth-font ();
95
94
@include token-utils .create-token-slot (font-family , container- text- font);
96
95
@include token-utils .create-token-slot (line-height , container- text- line- height);
97
96
@include token-utils .create-token-slot (font-size , container- text- size);
Original file line number Diff line number Diff line change 1
- @use ' @material/typography/typography' ;
2
1
@use ' @material/feature-targeting/feature-targeting' ;
3
2
@use ' @material/density/functions' as density-functions ;
4
3
@use ' @material/list/evolution-mixins' as mdc-list ;
22
21
@include mdc-list .item-end-size (40px , $query : $query );
23
22
24
23
& .mdc-list-item--with-two-lines {
24
+ $top : 32px ;
25
+ $bottom : 20px ;
26
+
25
27
.mdc-list-item__primary-text {
26
- @include typography .text-baseline ($top : 32px , $bottom : 20px , $query : $query );
28
+ display : block ;
29
+ margin-top : 0 ;
30
+ line-height : normal ;
31
+ margin-bottom : $bottom * -1 ;
32
+
33
+ // This was used by MDC to set the text baseline. We should figure out a way to
34
+ // remove it, because it can introduce unnecessary whitespace at the beginning
35
+ // of the element.
36
+ & ::before {
37
+ display : inline-block ;
38
+ width : 0 ;
39
+ height : $top ;
40
+ content : ' ' ;
41
+ vertical-align : 0 ;
42
+ }
43
+
44
+ & ::after {
45
+ display : inline-block ;
46
+ width : 0 ;
47
+ height : $bottom ;
48
+ content : ' ' ;
49
+ vertical-align : $bottom * -1 ;
50
+ }
27
51
}
28
52
}
29
53
Original file line number Diff line number Diff line change 1
1
@use ' @angular/cdk' ;
2
- @use ' @material/typography/typography' as mdc-typography ;
3
2
@use ' ../core/tokens/m2/mat/paginator' as tokens-mat-paginator ;
4
3
@use ' ../core/tokens/token-utils' ;
4
+ @use ' ../core/style/vendor-prefixes' ;
5
5
6
6
$padding : 0 8px ;
7
7
$page-size-margin-right : 8px ;
@@ -21,7 +21,7 @@ $button-icon-size: 28px;
21
21
tokens-mat-paginator .$prefix ,
22
22
tokens-mat-paginator .get-token-slots ()
23
23
) {
24
- @include mdc-typography .smooth-font ();
24
+ @include vendor-prefixes .smooth-font ();
25
25
@include token-utils .create-token-slot (color , container- text- color);
26
26
@include token-utils .create-token-slot (background-color , container- background- color);
27
27
@include token-utils .create-token-slot (font-family , container- text- font);
Original file line number Diff line number Diff line change 1
1
@use ' sass:math' ;
2
2
@use ' @angular/cdk' ;
3
- @use ' @material/typography/typography' as mdc-typography ;
4
3
@use ' ../core/style/vendor-prefixes' ;
5
4
@use ' ../core/style/variables' ;
6
5
@use ' ../core/tokens/token-utils' ;
@@ -22,7 +21,7 @@ $scale: 0.75 !default;
22
21
23
22
@include token-utils .use-tokens (
24
23
tokens-mat-select .$prefix , tokens-mat-select .get-token-slots ()) {
25
- @include mdc-typography .smooth-font ();
24
+ @include vendor-prefixes .smooth-font ();
26
25
@include token-utils .create-token-slot (color , enabled- trigger- text- color);
27
26
@include token-utils .create-token-slot (font-family , trigger- text- font);
28
27
@include token-utils .create-token-slot (line-height , trigger- text- line- height);
You can’t perform that action at this time.
0 commit comments